Reputation: 19
Hi I am using below code in build step in jenkin
#!/bin/bash
pwd
cd ./eclipse-workspace/SoapUiTest
pwd
javac -classpath "lib/* -d ./bin ./src/defaultPackage/*.java"
java -cp "bin;lib/* org.testng.TestNG testng.xml"
while running job i am getting below error
javac: no source files Usage: javac use -help for a list of possible options Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) where options include: -d32 use a 32-bit data model if available -d64 use a 64-bit data model if available -server to select the "server" VM -zero to select the "zero" VM -dcevm to select the "dcevm" VM The default VM is server, because you are running on a server-class machine. -cp <class search path of directories and zip/jar files> -classpath <class search path of directories and zip/jar files> A : separated list of directories, JAR archives, and ZIP archives to search for class files.
Upvotes: 0
Views: 39
Reputation: 46943
An obvious error is the mixure of flags in flag values in javac command:
#!/bin/bash
pwd
cd ./eclipse-workspace/SoapUiTest
pwd
javac -classpath "lib/*" -d "./bin" "./src/defaultPackage/*.java"
java -cp "bin;lib/* org.testng.TestNG testng.xml"
javac
command explanation: you specify where to find additional class binaries that the compilation depends on, where to output the compiled files and finally where to read the sources from.
Upvotes: 1