How to compile a class into Jdk 1.1 version, which was in Jdk 1.6?

This is too urgent for me. Bad I need a solution.

I have a .class file which is in jdk version 1.1. When I tried to compile Jdk 1.5 and 1.6. It shows BadClassVersionError.

So, I tried for jdk 1.1 version. I can’t get it from anywhere. In addition to the site sun java. but when I try to install, it does not install.

As I searched google, I found out that there is another option

so that we can compile our class in version 1.1.

Hello.java is my java file. and my current version is jdk 1.6

When I use the following command:

javap -verbose hello

Shows low version: 0 and main version: 50

Now I used the following command:

javac -target 1.5 Hello.java

It works correctly .. Now it shows the main version 49

But the problem is that I am trying to execute the same command with target 1.1 .

javac -target 1.1 Hello.java

Does not work. It shows the error below:

javac: target version 1.1 conflicts with the original release of version 1.5 **

Who can I help with ... Misuse of the team?

If this is wrong, give me a clean command so that I can use it,

+4
source share
1 answer

Add -source 1.1 to your command line

javac -source 1.1 -target 1.1 Hello.java 
+7
source

Source: https://habr.com/ru/post/1385468/


All Articles