简体   繁体   English

为什么我的jarsigner无法工作?

[英]Why won't my jarsigner work?

For some reason why I try any command including just jarsigner it gives me the following error: 由于某些原因,为什么我尝试任何命令,包括jarsigner ,都会出现以下错误:

Error: Could not find or load main class sun.security.tools.JarSigner

Do I have an incorrect version of Java? 我的Java版本不正确吗? I've re-installed Java many times and tried 64 bit and 32 bit versions. 我已经重新安装了Java多次,并尝试了64位和32位版本。 I have the newest version of the Java JDK ( Java 7 update 45 ) on Windows 7. Also, my javac command gives me a similar error: 我在Windows 7上拥有Java JDK的最新版本( Java 7 update 45 )。此外,我的javac命令给我一个类似的错误:

Error: Could not find or load main class com.sun.tools.javac.Main

But, my java command doesn't. 但是,我的java命令没有。

My PATH includes the java jdk bin C:\\Program Files\\Java\\jdk1.7.0_45\\bin , Do I need anything else? 我的PATH包含java jdk bin C:\\Program Files\\Java\\jdk1.7.0_45\\bin ,我还需要其他吗? My CLASSPATH is .;C:\\Program Files (x86)\\Java\\jre7\\lib\\ext\\QTJava.zip and I tried changing it to just . 我的CLASSPATH.;C:\\Program Files (x86)\\Java\\jre7\\lib\\ext\\QTJava.zip ,我尝试将其更改为just . but that didn't work either. 但这也不起作用。 I also tried setting the variable to Path instead of PATH but the same error came out. 我也尝试将变量设置为Path而不是PATH但是出现了相同的错误。 I have searched many times in my PATH environment variable and there are no signs of the word Java . 我已经在PATH环境变量中搜索了很多次,并且没有Java单词的迹象。 The bin above for my PATH is the only sign of the word Java . 上面PATH的bin是Java单词的唯一标志。 Right now I have my Java bin in my user environment variables. 现在,我的用户环境变量中有Java bin。 Do I need it in the system environment variables? 我在系统环境变量中需要它吗?

Thanks. 谢谢。

Your PATH is wrong, or it contains a bin directory from an obsolete or largely uninstalled JDK, or your CLASSPATH points to an obsolete JDK, or possibly a JRE. 您的PATH错误,或者它包含来自已过时或已大量卸载的JDK的bin目录,或者您的CLASSPATH指向已过时的JDK或可能是JRE。 If either of the latter, remove that element from the PATH or CLASSPATH. 如果是后者,则从PATH或CLASSPATH中删除该元素。

What do I actually need for the CLASSPATH if I need anything. 如果我需要什么,我实际上对CLASSPATH需要什么。

There's no need for a CLASSPATH setting other than '.' 除“。”外,不需要CLASSPATH设置。 as far as Java itself is concerned. 就Java本身而言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM