Fixing java.lang.UnsupportedClassVersionError in Java

0 votes
I am using Notepad to write, edit the Java code. But when I am running this code, I am getting java.lang.UnsupportedClassVersionError. How to fix it?
Jun 7, 2018 in Java by Daisy
• 8,110 points
292 views

1 answer to this question.

0 votes

To fix the exception/ error, you should try to either run the Java code with a newer version of Java JRE or specify the target parameter to the Java compiler to instruct the compiler to create code compatible with earlier Java versions.

javac -target 1.4 HelloWorld.java
answered Jun 7, 2018 by sharth
• 3,370 points

Related Questions In Java

0 votes
1 answer
0 votes
2 answers

How can I solve java.lang.NoClassDefFoundError in Java?

NoClassDefFoundError means that the class is present ...READ MORE

answered Sep 11, 2018 in Java by Sushmita
• 6,890 points
6,095 views
+1 vote
1 answer

How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

This error means you're trying to load ...READ MORE

answered Jun 8, 2018 in Java by Rishabh
• 3,580 points
1,517 views
0 votes
1 answer

Error:“java.lang.OutOfMemoryError: PermGen space” in Maven build

Hello @kartik, When you increased MAVEN_OPTS, you increase the MaxPermSize, ...READ MORE

answered Jun 3 in Java by Niroj
• 78,520 points
228 views
0 votes
1 answer

What is ArrayIndexOutOfBoundsException ?

If You check System.out.print(names.length); you will get 3 ...READ MORE

answered May 11, 2018 in Java by sharth
• 3,370 points
198 views
0 votes
1 answer

How can we resolve ClassNotFoundException in Java?

Your classpath is broken. Depending on how you ...READ MORE

answered May 22, 2018 in Java by Akrati
• 3,170 points
207 views
0 votes
1 answer

How to resolve the java.net.ConnectException in Java?

If you are getting java.net.ConnectionException, it means ...READ MORE

answered Jun 4, 2018 in Java by Akrati
• 3,170 points
827 views
0 votes
1 answer

Fixing android.os.NetworkOnMainThreadException in Java

Android has some good tips on good ...READ MORE

answered Jun 12, 2018 in Java by Rishabh
• 3,580 points
3,629 views
+1 vote
1 answer

How can we resolve java.lang.OutOfMemoryError in Java?

Work with smaller batches of HashMap Objects ...READ MORE

answered Jun 5, 2018 in Java by sharth
• 3,370 points
198 views
0 votes
1 answer

How to prevent java.lang.NumberFormatException in Java?

"N/A" is not integer. It must throw NumberFormatException if you ...READ MORE

answered Jun 26, 2018 in Java by sharth
• 3,370 points
1,794 views