Reputation: 1783
#!/bin/ksh
echo "Some Programme v1.0.0"
JAVA_HOME=/apps/clear/jdk1.7.0_45
PATH=${JAVA_HOME}/bin:${JAVA_HOME}/lib:/usr/local/bin:/bin:/usr/bin:.:
export NEWAPI_DIR=/local/newapi/1.1.1.1.2
LIBRARY_PATH=$NEWAPI_DIR/Linux-2.6/lib
MY_HOME=/home/clear/dev/app/lse
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$LIBRARY_PATH
MY_CLASSPATH=${MY_HOME}/lib/yt500.jar:${JAVA_HOME}/jre/lib/rt.jar:${MY_HOME}/lib/ftlse.jar:$LIBRARY_PATH/JNewApi.jar:$LIBRARY_PATH/Jfib.jar
date
$JAVA_HOME/bin/java -version
$JAVA_HOME/bin/java -classpath $MY_CLASSPATH com.company.ft.lse.LseParser /home/clear/dev/app/lse/config/config.xml
date
The above is my run script. I have an application LseParser.java
to which I have changed the code. But this code is not reflected when I have run the code (. ./run) in unix box. When I locate the ftlse.jar
within where the LseParser.class
exists, it is last date modified some long time ago. Can someone please point me what i'm doing wrong or suggest any checks or alterations I should make ? am i missing any lines in my script i should have ?
Upvotes: 0
Views: 227
Reputation: 116
I think you missed export before JAVA_HOME in 3rd line... so the shell, instead of taking $JAVA_HOME it as a variable, interpret it as a command.
Upvotes: 0
Reputation: 437
Java is a compiled language. You need to run the javac compiler first and then the jar command to create the jar file. You can use the tutorials I linked to to figure out how to run them correctly for your project. Once you have your compile and package commands you can add them to your run script. However, I strongly recommend you look into a build automation tool such as Maven so that you don't have to work with custom built run scripts.
Upvotes: 1