Description of problem: I have just packaged the Node.js wrapper for closure-compiler (BZ#1090187) with the package replacing the bundled jar by a link to the jar from the closure-compiler package. I'm now packaging another Node.js module that uses the wrapper (BZ#1090189) and we're seeing exceptions from the closure compiler: Error: Exception in thread "main" java.lang.NoClassDefFoundError: org/kohsuke/args4j/CmdLineException at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2531) at java.lang.Class.getMethod0(Class.java:2774) at java.lang.Class.getMethod(Class.java:1663) at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486) Caused by: java.lang.ClassNotFoundException: org.kohsuke.args4j.CmdLineException at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 6 more What I've found is that if I download the exact same version from upstream (http://dl.google.com/closure-compiler/compiler-20140110.tar.gz) and use the jar from that then it works - the jar is also nearly twice the size of the one in the closure-compiler rpm. Version-Release number of selected component (if applicable): closure-compiler-20140110-2.fc21
The command that the Node.js wrapper is executing is: java -jar /usr/lib/node_modules/closure-compiler/lib/vendor/compiler.jar --warning_level QUIET --compilation_level SIMPLE_OPTIMIZATIONS which is equivalent (via a symbolic link) to: java -jar /usr/share/java/closure-compiler.jar --warning_level QUIET --compilation_level SIMPLE_OPTIMIZATIONS both commands abort in the same way for me, with the exception shown above.
So the issue is that the upstream compiler.jar bundles various things which are separate in Fedora and need to be added to the classpath. Looks like I need to patch the Node wrapper to invoke closure-compiler properly.
Yes, the classpath must be included. You can have a look at /usr/bin/closure-compiler for the list, it's rather long. I agree that invoking the binary (script really) directly is better.