For some reason why I try any command including just jarsigner it gives me the following error:

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

Do I have an incorrect version of Java? I've re-installed Java many times and tried 64 bit and 32 bit versions. 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:

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

But, my java command doesn't.

My PATH includes the java jdk bin C:\Program Files\Java\jdk1.7.0_45\bin, Do I need anything else? My CLASSPATH is .;C:\Program Files (x86)\Java\jre7\lib\ext\QTJava.zip and I tried changing it to just . but that didn't work either. I also tried setting the variable to Path instead of PATH but the same error came out. I have searched many times in my PATH environment variable and there are no signs of the word Java. The bin above for my PATHis the only sign of the word Java. Right now I have my Java bin in my user environment variables. 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. If either of the latter, remove that element from the PATH or CLASSPATH.

What do I actually need for the CLASSPATH if I need anything.

There's no need for a CLASSPATH setting other than '.' as far as Java itself is concerned.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top