-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
closure-compiler-v20240317 '(class file version 55.0)` and closure-compiler-unshaded-v20240317 'no main manifest attribute' using Java 8u431 #4208
Comments
Note that Java 11 or newer is required at this time to run closure-compiler - see https://github.com/google/closure-compiler/wiki/FAQ#What-version-of-Java-is-required. The unshaded jar isn't suitable for running directly via |
@niloc132 Why do I need to download the JDK to just run a Java program? Java is notorious for version numbering confusion. The JDK current version is named Java 23. The latest release of JRE (Runtime) is Java 8 Update 431 (2024-10-15) I may assume that JRE 8_u431 has the same JVM as JDK 23/22. |
I'm afraid that assumption is wrong - there is no more "JRE" as of Java 9 - instead the JDK (which includes everything in the JRE) is provided and can be used as a JRE. Alternatively, some applications will use the Some older versions of Java continue to be supported by some maintainers - notably, 8, 11, 17, and 21 at this time. As my link indicates, at this time closure-compiler can run on Java 11+, so you need a version of Java (that is, a JDK) at least that new. In theory you could run jlink yourself to let the closure-compiler run standalone, but the closure-compiler project does not do that for you. There are however "native" builds of closure-compiler that are available, using Graal - but these must be made per OS/platform, and it is technically possible that your own computer might not have a build appropriate to it. In that case, the tooling that uses these native builds will download the jar file, and will need an appropriate Java version to run it on. See https://github.com/google/closure-compiler-npm/blob/master/packages/google-closure-compiler/README.md for more information on this. |
Thanks for the detailed explanation @niloc132. I'll close this issue, since it's working as intended |
Following the Getting Started with the Closure Compiler Application page I installed Java Version 8 Update 431 (64-bit) for Windows 11. Installed on disk in the confusing directory
C:\Program Files\Java\jre1.8.0_431
Getting the latest
closure-compiler
from Maven repository (closure-compiler-v20240317.jar)Running with
I get the error
Looking at some other issues I found that there is also a
closure-compiler-unshaded
version. Searching on Maven I downloadedclosure-compiler-unshaded-v20240317.jar
Running with
I get the error
If I go back a few versions I can use the
v20211201
without error.What is the difference between
closure-compiler
andclosure-compiler-unshaded
?Why does
closure-compiler-v20240317
have amain manifest attribute
butclosure-compiler-unshaded-v20240317
not?How to run
closure-compiler
with JavaRE 8u431?Fixing the missing
main manifest attribute
inclosure-compiler-unshaded-v20240317
results in ajava.lang.ClassNotFoundException
exception.Even going back to 2013 that line, if present in the jar MANIFEST, is
The text was updated successfully, but these errors were encountered: