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

Make it work on Windows #12

Closed
jzaefferer opened this issue Mar 20, 2013 · 32 comments
Closed

Make it work on Windows #12

jzaefferer opened this issue Mar 20, 2013 · 32 comments

Comments

@jzaefferer
Copy link
Contributor

Supposedly its not working. Need to test at least once.

@PangbornIdentity
Copy link

as Default:
Running "htmllint:all: task

Error; Error: not found: java

Although java is running on my windows 7 system.
-rich

@jzaefferer
Copy link
Contributor Author

I've tested it on my own Windows 7 machine and it works fine. I need more information to reproduce the issue.

@fnagel
Copy link

fnagel commented Apr 23, 2014

Same problem on Win 8.1. Tried a fresh npm install in Windows default cmd with admin rights -- without success. I'm pretty sure it works on my Windows7 machine. I will try to verify that.

Any ideas?

@jzaefferer
Copy link
Contributor Author

Have you checked if you can run java --version outside of grunt on the command line?

See also this StackOverflow entry, which has comments asking the same question: http://stackoverflow.com/questions/20264628/grunt-htmllint-error-cant-find-java

@fnagel
Copy link

fnagel commented Apr 23, 2014

This works:

$ java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)

@LaurentGoderre
Copy link
Collaborator

Just to be sure though, are you running grunt and java -version from the same command line?

@fnagel
Copy link

fnagel commented Apr 23, 2014

Yes.

@LaurentGoderre
Copy link
Collaborator

What happens if you run java -jar [path to jar] (drag and drop the actual JAR to be safer)?

@fnagel
Copy link

fnagel commented Apr 23, 2014

This seems to work when using command line. I'm not sure what is meant with drag and drop?

$ java -jar node_modules/grunt-html/vnu.jar
Usage:

    java -jar vnu.jar [--entities] [--errors-only] [--no-stream]
         [--format gnu|xml|json|text] [--help] [--html] [--schema URL]
         [--verbose] [--version] FILES

    java -cp vnu.jar nu.validator.servlet.Main 8888

    java -cp vnu.jar nu.validator.client.HttpClient FILES

For detailed usage information, use "java -jar vnu.jar --help" or see:

  http://validator.github.io/

To read from stdin, use "-" as the filename, like this: "java -jar vnu.jar - ".

@LaurentGoderre
Copy link
Collaborator

Well that is very strange....

@jzaefferer
Copy link
Contributor Author

Can you try this?

npm install which
node -e 'console.log(require("which").sync("java"));'

On my system that logs /usr/bin/java. You should get something...

@fnagel
Copy link

fnagel commented Apr 23, 2014

Getting an error:

$ node -e 'console.log(require("which").sync("java"));'

d:\GIT\_jQuery\jquery-ui\node_modules\which\which.js:83
  throw new Error("not found: "+cmd)
        ^
Error: not found: java
    at Function.whichSync [as sync] (d:\GIT\_jQuery\jquery-ui\node_modules\which\which.js:83:9)
    at [eval]:1:30
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:532:25)
    at startup (node.js:80:7)
    at node.js:902:3

@LaurentGoderre
Copy link
Collaborator

Is Java in your PATH?

@fnagel
Copy link

fnagel commented Apr 24, 2014

No. I added it and tried a PATH var like this but without success:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files\nodejs\;C:\Program Files (x86)\Java\jre7\bin

One question: do I need java AND javac (aka JRE or SDK)? It seems I've only installed the runtime.

@LaurentGoderre
Copy link
Collaborator

You should only need the JRE

@jzaefferer
Copy link
Contributor Author

@fnagel did you ever get this resolved?

@fnagel
Copy link

fnagel commented May 19, 2014

Nope, but I could try again... it worked before so...

@fnagel
Copy link

fnagel commented Jun 16, 2014

Tried this again for datepicker (after merging master). Deleted node_modules directory and rerun npm install with admin privileges.

It still fails but I get a different error message:

Running "htmllint:all" (htmllint) task
>> Error: Exception in thread "main" java.lang.StackOverflowError
>>      at com.thaiopensource.relaxng.impl.DuplicateAttributeDetector.startChoice(Unknown Source)
>>      at com.thaiopensource.relaxng.impl.ChoicePattern.checkRestrictions(Unknown Source)

@LaurentGoderre
Copy link
Collaborator

@fnagel the latest version should fix this problem

@jzaefferer
Copy link
Contributor Author

You may have to explicitly install this module if the version in package.json is out of date, so

npm install grunt-html

@fnagel
Copy link

fnagel commented Jun 17, 2014

I've updated the jQueryUI package json to grunt-html 1.4.0 and did same installation process as described above. Same error.

Installing with npm install grunt-html doesn't help either.

@LaurentGoderre
Copy link
Collaborator

WHich version of Windows, 64 or 32 bits? What version of Java and what architecture of java (32 or 64)

@fnagel
Copy link

fnagel commented Jun 17, 2014

Windows: 8.1 Pro 64bit
Java: 1.7.0_55 32bit

@LaurentGoderre
Copy link
Collaborator

This stack size thing is a nightmare...

@LaurentGoderre
Copy link
Collaborator

@fnagel It would probably help a lot to install 64bits JRE on a 64bits system but I'll see if there something that can be done.

@LaurentGoderre
Copy link
Collaborator

@jzaefferer perhaps we have to detect the Java architecture instead of the system one.

@jzaefferer
Copy link
Contributor Author

It would probably help a lot to install 64bits JRE on a 64bits system

That should be worth a try.

perhaps we have to detect the Java architecture instead of the system one.

My installed java responds to java -version (--version is unrecognized, ugh). Parsing this looks terrible:

java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Gonna reopen this anyway.

@jzaefferer jzaefferer reopened this Jun 18, 2014
@LaurentGoderre
Copy link
Collaborator

From my research, we have too look for 64-Bit Server VM If it's not present then it's 32bits

@fnagel
Copy link

fnagel commented Jun 19, 2014

I've tried to change to 64bit architecture: installed 64bit, changed system path variable and rebooted -- command line still seems to use 32bit:

$ java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b14)
Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode, sharing)

I will give it another try by removing java completely and then reinstall it.

@fnagel
Copy link

fnagel commented Jul 31, 2014

I have absolutely no clue why but grunt htmllint (testcase is jQuery UI master branch) works now.

I did not change anything java specific (since my last comment). Can somebody confirm it#s working on Windows 8.1?

Anyway, I'm happy as I'm finally able to run all tests for jQuery UI.

@jzaefferer
Copy link
Contributor Author

"Did you try turning it off and on again?"

Let's hope this is now resolved and we can leave this ticket closed.

@LaurentGoderre
Copy link
Collaborator

We still need to add a fix to detect the Java version. That's an issue that come's up fairly often with our developers.

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

4 participants