Friday, May 3, 2019

Run built JAVA program on linux with dependent jar files

/myapp/WL12c/app/oracle/jdk1.8.0_211/bin/java -cp /home/app/ERApp/lib/commons-cli-1.4/commons-cli-1.4.jar:/home/myapp/ERApp/lib/ojdbc14.jar: com.bloomburger.datalic.dlws.PerSecurity -s GetAllExRates -p scheduled &>>output.txt &


Explanation:

java installed location -> /app/WL12c/app/oracle/jdk1.8.0_211/bin/java

classpath or dependent jar locations-> -cp /home/app/ExchangeRatesApp/lib/commons-cli-1.4/commons-cli-1.4.jar:/home/app/ERApp/lib/ojdbc14.jar

in the generated classes folder-> com.bloomburger.datalic.dlws.PerSecurity (make sure you get to the folder where com(com.bloomberg.datalic.dlws.PerSecurity) exists and run above command in blue color)

Pass Arguments to the java class file : -s GetAllExRates -p scheduled

Save the logs to file exit with background running enable -> &>>output.txt &






No comments: