Skip to content
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_PATH location issues on Win7 #14

Open
soluml opened this issue Nov 28, 2012 · 5 comments
Open

CLOSURE_PATH location issues on Win7 #14

soluml opened this issue Nov 28, 2012 · 5 comments

Comments

@soluml
Copy link

soluml commented Nov 28, 2012

Hello All,

I've tried every variation I can think of to get this working. I've used the closurePath param, I've used system variables, but I cannot get this task to run without it failing, telling me that it cannot find the jar.

Is anyone else having issues on Windows or is it just me? My grunt.js file is in a root directory. I've added a 'Closure Compiler' directory with the compiler.jar file inside. It's one level up. Here are some example values I've set for the closurePath -

closurePath: '',

closurePath: '/',

closurePath: 'Closure Compiler',

closurePath: '/Closure Compiler',

closurePath: 'Closure Compiler/',

closurePath: '/Closure Compiler/',

closurePath: 'Closure Compiler/compiler',

closurePath: '/Closure Compiler/compiler',

closurePath: 'Closure Compiler/compiler.jar',

closurePath: '/Closure Compiler/compiler.jar',

Nothing works. I've tried every variation I thought it could be. Here's my object as it stands now:

'closure-compiler' : {
frontend: {
closurePath : 'Closure Compiler/',
js : 'components/footer.js',
jsOutputFile: 'js/footer.min.js',
maxBuffer : 500,
options : {
compilation_level: 'SIMPLE_OPTIMIZATIONS'
}
}
},

@gmarty
Copy link
Owner

gmarty commented Dec 4, 2012

Hi man! Sorry for the delay.
How did you install Closure Compiler (From source or just downloaded the jar)? Where is it now?
You just pass the full path of your install to closurePath and it should work.

@soluml
Copy link
Author

soluml commented Dec 5, 2012

I just used a jar.

I downloaded the jar and placed it here: C:\Users\Name\Dropbox\Closure Compiler\compiler.jar

The grunt.js file is here: C:\Users\Name\Dropbox\grunt.js

I've tried all the settings above as well as using the full path above. Have you been able to run this on windows? This is the warning I'm getting:

"Command failed: Unable to access jarfile C:/Users/Name/Dropbox/Closure Use --force to continue."

Seems like it's having issues reading the whole folder path.

@harriha
Copy link

harriha commented Mar 30, 2013

Hi,

My 2 cents in form of an educated guess: issue with whitespace in the path and fix would be similar to this one yeoman/yeoman#873 ?

@UltCombo
Copy link
Contributor

Little late to reply but anyway, after fixing the whitespace issue, you will need to move your built files to inside a /build subdirectory.

For example, using this setting:

closurePath: 'C:/closure'

Your compiler.jar should be at:

C:/closure/build/compiler.jar

This is because this grunt task currently appends /build/compiler.jar to the closurePath (see here).

@sanjaykhadka
Copy link

Now I'm getting an issue.
Ive installed using npm package manager and I am using grunt to run it.
Downloaded jar file, pasted it into a build folder inside node_modules/grunt-closure-compiler and run
Now the issue is this, java error.

Warning: Command failed: 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.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Use --force to continue.


Looks like version error. What should I do now? Using npm install grunt-closure-compiler doesnt download build/compiler.jar file. Ive manually downloaded jar file and used, but still problem.
I've given path like this: closurePath: 'node_modules/grunt-closure-compiler',
Any solution for me.
I am in a mac machine.

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

No branches or pull requests

5 participants