When running the batch commando below, this works but when doing it in Jenkins, I get an error. I have read some topics and I have the java jre installed and have the systems variables (path & java_home) also correct.
cd C:\Users\muhar\Desktop\JavaProjects
javac HelloWorld.java
java HelloWorld
Error in Jenkins:
Started by user admin
Building on master in workspace C:\Program Files (x86)\Jenkins\workspace\HelloWorld
[HelloWorld] $ cmd /c call C:\Windows\TEMP\jenkins7014006052240288157.bat
C:\Program Files (x86)\Jenkins\workspace\HelloWorld>cd C:\Users\muhar\Desktop\JavaProjects
C:\Users\muhar\Desktop\JavaProjects>javac HelloWorld.java
'javac' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\muhar\Desktop\JavaProjects>java HelloWorld
'java' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\muhar\Desktop\JavaProjects>exit 9009
Build step 'Voer Windows batch commando uit.' marked build as failure
Finished: FAILURE
So, I am not sure what I am doing wrong here. Can anyone help?