I have a .class file which is in jdk 1.1 version. When i tried to compile in Jdk 1.5 and 1.6, it shows BadClassVersionError.
So I tried for jdk 1.1 version. I am unable to get it from anywhere. Except from sun's java site. but when I try to install, its not installing.
As I searched google, I came to know that there is an other option so that we can compile our class in 1.1 version.
Hello.java is my java file. and my current version is jdk 1.6
When I use the below command:
javap -verbose Hello
It shows minor version : 0 and major version : 50
Now I used the below command :
javac -target 1.5 Hello.java
It works correctly. Now it shows major version as 49.
But the problem is when I try the same command with target 1.1.
javac -target 1.1 Hello.java
It's not working, it shows the below error:
javac: target release 1.1 conflicts with default source release 1.5
Is the command usage wrong?
Add -source 1.1 to your commandline
javac -source 1.1 -target 1.1 Hello.java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With