0
votes

Been searching all day for why Jenkins does not execute a Windows batch command java x.y.java$Test

If you open windows cmd and execute java x.y.java$Test it works just fine. I can execute the cmd from any directory and the java is executed.

CLASSPATH is the same when I view Jenkins Environment variables or the systems variables. I'm running Windows 7

Running Jenkins 2.138.1

Here is the error message:

Error: Could not find or load main class bichromate.core.sTestCleanupFactory$Test

any suggestions would be helpful

1
Have you tried running inside the batch a java -version or a echo %cd%?S.Spieker
Can you share the error logs?Ravindranath Barathy
Do an echo PATH and see whats the differencerohit thomas
command is: java bichromate.core.sTestCleanupFactory$Test Error message added: Error: Could not find or load main class bichromate.core.sTestCleanupFactory$Test All works well when run from the CMD prompt from any directory if I look at CLASSPATH for JENKINS and WINDOWS they are the same Thank you again for all the support.Gringo Golf

1 Answers

0
votes

So it works in jenkins if you add the -cp

EXAMPLE: java -cp path to the class then the qualified class file