2

I have downloaded the program:

wget https://github.com/crawljax/crawljax/releases/download/crawljax-3.6/crawljax-cli-3.6.zip

Unzip it:

unzip crawljax-cli-3.6.zip

get in the folder and run:

java -jar crawljax-cli-3.6.jar

This is the error I get:

java -jar crawljax-cli-3.6.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/crawljax/cli/JarRunner : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: com.crawljax.cli.JarRunner. Program will exit.

I have done this:

apt-get install default-jre
apt-get install default-jdk

But is the same error

My version of java:

javac -version

javac 1.6.0_35

java -version

java version "1.6.0_35" OpenJDK Runtime Environment (IcedTea6 1.13.7) (6b35-1.13.7-1~deb7u1) OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

I have read this is because I have compiled with a higher version than the one is executing on the JVM, but I have no source code here to recompile, I just have the .jar.

3 Answers 3

1

As you noted, you are attempting to run a JAR compiled for Java 7 with JRE 6. Just install JRE from Java 7:

apt-get install openjdk-7-jre 
apt-get install openjdk-7-jdk # just for good measures

And set it as the default JRE:

update-alternatives --config java # and select Java 7
Sign up to request clarification or add additional context in comments.

Comments

1

You need to run this code with Java 7 since that is what it is compiled with.

Comments

1

When you open github : https://github.com/crawljax/crawljax/blob/master/pom.xml you should be able see in pom it is compiled in Java 1.7 and you are trying to run it in lower version. Below is cheatsheet for this kinda of errors:

The version number shown describes the version of the JRE the class file is compatible with. The reported major numbers are:

J2SE 8 = 52,
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45

Either you can run it in higher version or change pom properties to 1.6 and build it. but running it in 1.7+ version is better idea.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.