简体   繁体   中英

changes to java program not being reflected

#!/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 ?

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.

我认为您在第3行中错过了JAVA_HOME之前的导出...因此,shell而不是将$ JAVA_HOME当作变量,而是将其解释为命令。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM