Closed mappetz closed 9 years ago
Hi Nikku, https://github.com/Nikku/node-xsd-schema-validator/blob/master/lib/validator.js#L15 I'm using your module in a Windows environment and this if statement fails in windows because the file is named "javac.exe".
Below the debugging results: I will let you resolve the issue, otherwise I can do it and require a pull request, let me know.
Just to know, this works for me:
function withValidator(callback) { if (!JAVA_HOME) { callback(new Error('JAVA_HOME is not defined')); } else if (!fs.existsSync(JAVA_HOME + '/bin/javac.exe')) { callback(new Error('JDK required at JAVA_HOME to compile helper')); } else { if (fs.existsSync(VALIDATOR + '.class')) { callback(); } else { spawn(JAVA_HOME + '/bin/javac.exe', [ 'support/XMLValidator.java' ], { cwd: __dirname + '/../' }).on('exit', callback); } } }
Do the test-cases fail for you on windows?
Yes, grunt test fails using the string javac. Using the previous snippet, with javac.exe grunt test works fine.
javac
javac.exe
(My JDK is 1.7.0_40)
Could you checkout v0.1.0 to see if it fixed the issue?
Perfect, works fine, thank you.
Hi Nikku, https://github.com/Nikku/node-xsd-schema-validator/blob/master/lib/validator.js#L15 I'm using your module in a Windows environment and this if statement fails in windows because the file is named "javac.exe".
Below the debugging results:
I will let you resolve the issue, otherwise I can do it and require a pull request, let me know.
Just to know, this works for me: