compiler.jar return error

30 views
Skip to first unread message

Andrés Nadal

unread,
Sep 9, 2021, 1:18:57 PM9/9/21
to Closure Compiler Discuss
Hi.
When i run: java -jar compiler.jar --help

Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name com.google.javascript.jscomp.jarjar.org.kohsuke.args4j.Messages, locale en
        at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
        at java.util.ResourceBundle.getBundleImpl(Unknown Source)
        at java.util.ResourceBundle.getBundle(Unknown Source)
        at com.google.javascript.jscomp.jarjar.org.kohsuke.args4j.Messages.formatWithLocale(Messages.java:30)
        at com.google.javascript.jscomp.jarjar.org.kohsuke.args4j.CmdLineException.<init>(CmdLineException.java:47)
        at com.google.javascript.jscomp.jarjar.org.kohsuke.args4j.CmdLineParser$CmdLineImpl.getParameter(CmdLineParser.java:429)
        at com.google.javascript.jscomp.CommandLineRunner$Flags$BooleanOptionHandler.parseArguments(CommandLineRunner.java:1296)
        at com.google.javascript.jscomp.jarjar.org.kohsuke.args4j.CmdLineParser.parseArgument(CmdLineParser.java:520)
        at com.google.javascript.jscomp.CommandLineRunner$Flags.parse(CommandLineRunner.java:941)
        at com.google.javascript.jscomp.CommandLineRunner$Flags.access$500(CommandLineRunner.java:146)
        at com.google.javascript.jscomp.CommandLineRunner.initConfigFromFlags(CommandLineRunner.java:1601)
        at com.google.javascript.jscomp.CommandLineRunner.<init>(CommandLineRunner.java:1446)
        at com.google.javascript.jscomp.CommandLineRunner.main(CommandLineRunner.java:2214)
Caused by: java.lang.ClassCastException: com.google.javascript.jscomp.jarjar.org.kohsuke.args4j.Messages cannot be cast to ResourceBundle
        at java.util.ResourceBundle$Control.newBundle(Unknown Source)
        at java.util.ResourceBundle.loadBundle(Unknown Source)
        at java.util.ResourceBundle.findBundle(Unknown Source)
        at java.util.ResourceBundle.findBundle(Unknown Source)
        ... 12 more


Greeting

John

unread,
Sep 9, 2021, 7:32:56 PM9/9/21
to Closure Compiler Discuss
Can you provide some details here?  What version are you using?  Where did you retrieve it?  Did you build it from sources?

John

unread,
Sep 9, 2021, 8:18:13 PM9/9/21
to Closure Compiler Discuss
both the version of the compiler and version of java are interesting.

Andrés Nadal

unread,
Sep 10, 2021, 9:32:36 AM9/10/21
to closure-comp...@googlegroups.com
Thank you very much John, for responding.

The problem was the "!" on behalf of a folder within the access path to the js files.

Anyway, I will no longer use Closure Compiler, a lot of trouble shrinking a simple js file.

With jQuery dependencies, I had a lot of trouble, until I managed to make a js --externs file, to keep the "$".

Then ADVANCED_OPTIMIZATIONS trashes the function names, the script doesn't work at all.

SIMPLE_OPTIMIZATIONS, pollute my script, with -> $ jscomp.generator.Context.prototype.

I don't want to see that in my script, it is not my code.

Something that seemed great to me was, the warnings about how the code was written, but a variable or function not used in the script is eliminated. I think this can be solved, but you have to contaminate the code with @.

I have moved to Terser it seems much better, I am already in production again.

Thank you anyway

--

---
You received this message because you are subscribed to the Google Groups "Closure Compiler Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-compiler-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/closure-compiler-discuss/3f252eef-2454-41e7-beb7-878503382cfan%40googlegroups.com.

John

unread,
Sep 12, 2021, 1:16:23 AM9/12/21
to Closure Compiler Discuss
ADVANCED_OPTIMIZATIONS has special requirements and is intended for applications.  Unless you prepared your code for it, it is unlikely to work (such as proper externs).  SIMPLE_OPTIMIZATIONS are intended for unprepared code or file-by-file optimizations.    Likely, the "pollution" you are seeing is from downleveling.   Set --language_out=ECMASCRIPT_2021 if you con't want that (the current default is ECMASCRIPT5, something that I would like to change).
Reply all
Reply to author
Forward
0 new messages