Coder Social home page Coder Social logo

Comments (32)

PangbornIdentity avatar PangbornIdentity commented on May 29, 2024

as Default:
Running "htmllint:all: task

Error; Error: not found: java

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

from grunt-html.

jzaefferer avatar jzaefferer commented on May 29, 2024

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

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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?

from grunt-html.

jzaefferer avatar jzaefferer commented on May 29, 2024

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

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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)

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

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

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

Yes.

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

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

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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 - ".

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

Well that is very strange....

from grunt-html.

jzaefferer avatar jzaefferer commented on May 29, 2024

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...

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

Is Java in your PATH?

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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.

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

You should only need the JRE

from grunt-html.

jzaefferer avatar jzaefferer commented on May 29, 2024

@fnagel did you ever get this resolved?

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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)

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

@fnagel the latest version should fix this problem

from grunt-html.

jzaefferer avatar jzaefferer commented on May 29, 2024

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

npm install grunt-html

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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.

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

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

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

This stack size thing is a nightmare...

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

@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.

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

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

from grunt-html.

jzaefferer avatar jzaefferer commented on May 29, 2024

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.

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

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

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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.

from grunt-html.

fnagel avatar fnagel commented on May 29, 2024

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.

from grunt-html.

jzaefferer avatar jzaefferer commented on May 29, 2024

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

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

from grunt-html.

LaurentGoderre avatar LaurentGoderre commented on May 29, 2024

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.

from grunt-html.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.