• Register
2 votes
24 views

Problem:

I Create Loan.java and compile it with JDK 1.6

and Run Loan.class with JRE 1.5.

C:\Program Files\Java\jre1.5.0_06\bin>java -version
java version "1.5.0_06"

its shows error like bellow

C:\Program Files\Java\jre1.5.0_06\bin>java Loan
java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)

what should i do next ..

10 7 2
6,060 points

Please log in or register to answer this question.

1 Answer

2 votes

Answer:

You might know that your source is compiled for higher version of JRE or Java runtime if it doesn't work in JDK 1.5 then try to run on JDK 1.6 and you will be able to remove "Bad version number in .class file"

Hope this helps you.

11 6 4
34,950 points

Related questions

1 vote
1 answer 20 views
20 views
Problem: I Created a Loan.java and compile it with JDK 1.6 and Run Loan.class with JRE 1.5. C:\Program Files\Java\jre1.5.0_06\bin>java -version java version "1.5.0_06" The following thing gives an error message: C:\Program Files\Java ... Source)         at java.net.URLClassLoader.defineClass(Unknown Source)         at java.net.URLClassLoader.access$100(Unknown Source) what should i do next ..
asked Mar 27, 2020 LizzyM 6.1k points
0 votes
1 answer 83 views
83 views
Problem : I am getting this error when I include an opensource library that I had to compile from source. java lang unsupportedclassversionerror bad version number in class file
asked Oct 23, 2019 peterlaw 6.9k points
0 votes
1 answer 30 views
30 views
Therefore, I have to conclude something else, internal to a class itself, is throwing the exception?? Is that even possible?
asked Jan 4 TeamScript 13.5k points
0 votes
1 answer 4 views
4 views
Problem: I need someone’s assistance to solve my problem .. What version of adobe flash do i have
asked Apr 27 Ifra 36.4k points
1 vote
1 answer 6 views
6 views
Problem: I am unable to find out the solution, Please solve it : peer reports incompatible or unsupported protocol version.
asked Apr 4 MUHAMMAD MUNEEB 83k points
0 votes
1 answer 5 views
5 views
Problem: Please help me fix this dilemma: to build android project, which version of gradle is required
asked Apr 1 rakib1 51.5k points
1 vote
1 answer 5 views
5 views
Problem: How to fix this error : version `glibc_2.14' not found
asked Mar 13 MUHAMMAD MUNEEB 83k points
0 votes
1 answer 11 views
11 views
Problem: Why I got the error > Java virtual machine launcher error could not create the java virtual machine
asked Apr 30 ummeshani 9.5k points
0 votes
1 answer 4 views
4 views
Problem: How can I downgrade Java if it was not installed before?
asked Apr 12 Humaira ahmed 50.7k points
0 votes
1 answer 326 views
326 views
Problem: hello fellow developers, I am working on a Firebase messaging application on my Xcode 11, and the Swift version is 5. I really need your help as I am stuck on an issue and this is giving me a headache. Kindly help me to resolve this issue.
asked Oct 12, 2020 SapperIt 1.2k points