Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

java.lang.ClassNotFoundException: com.google.javascript.jscomp.CompilerOptions #136

Open
karambirsingh opened this issue Aug 2, 2016 · 2 comments

Comments

@karambirsingh
Copy link

Hi,

I am facing this issue whild building ui project with below environment setting -
Java: 8
gradle: 2.14.1
gradle-js-plugin:2.14.1
gradle-css-plugin:2.14.0

My UI project does not have any direct dependency on CompilerOptions.class or closure-compiler-vxxxxxx.jar. Looks like gradle-js-plugin:2.14.1 internally depends on closure-compiler, so it should automatically download required jar.

Please suggest how to overcome this issue. I tried to put latest of closure-compiler-v20160713.jar in my local repo but this also did not yeild any result.

Below is the stacktrace I am getting -

Caused by: java.lang.NoClassDefFoundError: com/google/javascript/jscomp/CompilerOptions
at com.eriwen.gradle.js.JsPlugin.apply(JsPlugin.groovy:38)
at com.eriwen.gradle.js.JsPlugin.apply(JsPlugin.groovy)
at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35)
at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:43)
at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:137)
at org.gradle.api.internal.plugins.DefaultPluginManager.addImperativePlugin(DefaultPluginManager.java:67)
at org.gradle.api.internal.plugins.DefaultPluginManager.addImperativePlugin(DefaultPluginManager.java:73)
at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:60)
at org.gradle.api.plugins.PluginContainer$apply.call(Unknown Source)

@eriwen
Copy link
Owner

eriwen commented Aug 19, 2016

Would you please give a code sample or describe how you're using the JS plugin?

@karambirsingh
Copy link
Author

I resolved this problem by putting required JARs on classpath like below -

buildscript {
dependencies {
. . .
classpath (group: "com.google.javascript", name: 'closure-compiler', version: XXX)
classpath (group: "com.yahoo.platform.yui", name: 'yuicompressor', version: XXX)
}}

This problem is only with gradle 2.14, till 2.13 I was not required to put closure-compiler and yuicompressor on classpath.

Can you please explain why it is so? And how it was working till 2.13 version.

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

No branches or pull requests

2 participants