Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Exception in thread "main" java.lang.UnsupportedClassVersionError #8

Closed
codinkai opened this issue Nov 28, 2013 · 7 comments
Closed

Comments

@codinkai
Copy link

Hi,

I would like to try this package. Unfortunately I get the following error, when I run the example code or the command line tool.
Can anyone help?

ccjs lib/File.js
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
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:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: com.google.javascript.jscomp.CommandLineRunner. Program will exit.

@dcodeIO
Copy link
Owner

dcodeIO commented Nov 28, 2013

This looks like a bug in closure compiler itself or some sort of corrupted .jar to me. Have you tried to reinstall the package entirely?

@codinkai
Copy link
Author

codinkai commented Dec 2, 2013

I have tried it with a local and a global installation of the package. Both do not work. We use the compiler on another project. Can this cause a conflict?
How do I get an non-corrupted version of the compiler? Can I just download it from the official page and replace it? Or are there any neccessary changes in the compiler from this project?

@dcodeIO
Copy link
Owner

dcodeIO commented Dec 2, 2013

Yes, you can download it from the official page and put the compiler.jar into the ./compiler directory. Let me know if this works.

http://dl.google.com/closure-compiler/compiler-latest.zip

@codinkai
Copy link
Author

codinkai commented Dec 2, 2013

Unfortunately this did not work. But I tried an older compiler.jar which I use on another project and it works. Perhaps it's because of my Java version.

java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (suse-36.2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

java -jar compiler.old.jar --version
Closure Compiler (http://code.google.com/closure/compiler)
Version: exported
Built on: 2013/02/28 16:05

java -jar compiler.original.jar --version
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
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:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: com.google.javascript.jscomp.CommandLineRunner. Program will exit.

Should the compiler complain about wrong type annotations? Or how can I enable this feature?

@dcodeIO
Copy link
Owner

dcodeIO commented Dec 2, 2013

Have you tried to install the official sun / openjdk 7 runtime instead?

@codinkai
Copy link
Author

codinkai commented Dec 2, 2013

No, I haven't. I have only tried to run it with openSuse's java-package. Previous version did work with that package. Seems like it's not working anymore with the current version. Will try it later.

@dcodeIO
Copy link
Owner

dcodeIO commented Dec 4, 2013

1c62e98

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants