Java version mismatch

0 votes

I'm using a machine with java version 1.8.0.111 to write map-reduce programs but on running in VMware it is giving me error as

"Unsupported major. minor version 52.0". 

On checking the java version in VMware it is 1.7.0_67. Can you please help me upgrade the java version?

Feb 21 in Java by Saira
46 views

1 answer to this question.

0 votes

We get this error when we write a map reduce program in eclipse with Java 1.8 and export the Jar file where Java 1.6 or 1.7 is supported, i.e. we compile java program in higher version of Java and run in lower version of Java.

Before exporting the jar file from eclipse select the version 1.6 or 1.7 rather than 1.8. Please follow the below steps:

(i) Right Click on project and go to "Properties".

(ii) Now Select "Java Compiler" and uncheck use compliance from execution.

(iii) Select 1.6/1.7 and click on "Ok".

image

Now you can export the jar file and execute the code.

answered Feb 21 by Vaishnavi

Related Questions In Java

+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,540 points
811 views
+1 vote
1 answer

How to tell the Maven to use the latest version of dependency in Java?

If you always want to use the ...READ MORE

answered Jun 26, 2018 in Java by Sushmita
• 6,880 points
1,580 views
0 votes
1 answer
0 votes
5 answers

How to compare Strings in Java?

String fooString1 = new String("foo"); String fooString2 = ...READ MORE

answered Jul 12, 2018 in Java by Daisy
• 8,050 points
117 views
+5 votes
3 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,380 points

edited Nov 6, 2018 by Omkar 8,261 views
0 votes
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,090 points
2,005 views
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,090 points
5,232 views
0 votes
1 answer

Selenium JARS(Java) missing from downloadable link

Nothing to worry about here. In the ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,090 points
512 views
+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,190 points
332 views
0 votes
2 answers

How can I convert a String variable to a primitive int in Java

 Here are two ways illustrating this: Integer x ...READ MORE

answered Aug 20 in Java by Sirajul
• 26,100 points
136 views