Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

This question already has an answer here:

I am trying to run a program on eclipse. I am getting the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Perlinit : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(
    at Method)
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
Could not find the main class: Perlinit. Program will exit.

Output of java -version is

java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-0ubuntu1~12.04.1)
OpenJDK Server VM (build 20.0-b12, mixed mode)

Output of javac -version javac 1.6.0_27

Where can I be going wrong?

share|improve this question

marked as duplicate by Seth, BuZZ-dEE, karel, minerz029, mikewhatever Dec 28 '13 at 6:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

The version number "major.minor version 51.0" show which Java was used to run eclipse.

51.0 = Java J2SE 7

To fix your problem you should try to run eclise with Java 7. This can be done by updating your Java configuration:

sudo update-alternatives --config java

Then select a Java 7 version and retry.

If Java 7 isn't installed you can get it with apt-get:

sudo apt-get install default-jdk
share|improve this answer
Thank you, this resolved the same issue for me! – dotancohen Oct 18 '13 at 11:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.