Reputation: 41
I'm trying to compile this java file manually (for learning purposes):
public class Test {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
So I saved file and run:
C:\Users\maikon.neitzel\Documents\Java>javac Test.java
No errors.
Next step:
C:\Users\maikon.neitzel\Documents\Java>java Test
Error loading class Test: Bad major version number
So I did my research and found things about the PATH.
So I did it:
This are the variable for my user:
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_102
PATH: %JAVA_HOME%\bin
JRE_HOME: C:\Program Files\Java\jre1.8.0_102
And there is another PATH for the system where I put the same:
%JAVA_HOME%\bin
This is on Windows 10, and with the last java 8 version.
Versions:
C:\Users\maikon.neitzel\Documents\Java>javac -version
javac 1.8.0_102
C:\Users\maikon.neitzel\Documents\Java>java -version
java version "1.1.8.16"
From where this java 1.1.8.16 is coming?
Thanks a lot!
Upvotes: 1
Views: 483
Reputation: 41
Solved. I found a c:\orant\jdk\bin
AFTER %JAVA_HOME%
at system variables. So I figured I needed %JAVA_HOME%
defined not only for my user, but at system variables too.
Upvotes: 1