对java程序的更改没有被反映出来

时间:2022-09-04 08:17:53
#!/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 ?

以上是我的运行脚本。我有一个应用程序LseParser.java我已经更改了代码。但是当我在unix框中运行代码(../ run)时,这个代码没有反映出来。当我在LseParser.class所在的位置找到ftlse.jar时,它是很久以前修改的最后一个日期。有人可以指出我做错了什么或建议我应该做的任何检查或改动吗?我错过了我应该拥有的剧本中的任何一行吗?

2 个解决方案

#1


1  

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.

Java是一种编译语言。您需要先运行javac编译器,然后运行jar命令来创建jar文件。您可以使用我链接的教程来确定如何为您的项目正确运行它们。获得编译和包命令后,可以将它们添加到运行脚本中。但是,我强烈建议您研究一下构建自动化工具,例如Maven,这样您就不必使用自定义构建的运行脚本。

#2


0  

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.

我认为你在第3行JAVA_HOME之前错过了导出...所以shell,而不是将$ JAVA_HOME作为变量,将其解释为命令。

#1


1  

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.

Java是一种编译语言。您需要先运行javac编译器,然后运行jar命令来创建jar文件。您可以使用我链接的教程来确定如何为您的项目正确运行它们。获得编译和包命令后,可以将它们添加到运行脚本中。但是,我强烈建议您研究一下构建自动化工具,例如Maven,这样您就不必使用自定义构建的运行脚本。

#2


0  

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.

我认为你在第3行JAVA_HOME之前错过了导出...所以shell,而不是将$ JAVA_HOME作为变量,将其解释为命令。