我是sygwin的新手,所以我可能做错了。
这是我的shell脚本:
!/bin/sh
set [-x]
export myInstallDirectory='/cygdrive/c/cygwin64/usr/uTrace_ServerMachine'
echo "myInstallDirectory=" $myInstallDirectory
export JAVA_HOME=/cygdrive/c/Java_JDK_SE_8_u77_64_bit
echo "JAVA_HOME = " $JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
echo "PATH =" $PATH
export CLASSPATH=$myInstallDirectory/bin/UtraceServer.jar:$CLASSPATH
echo "CLASSPATH=" $CLASSPATH
java -jar UtraceServer.jar
set [+x]
以下是日志显示的内容:
myInstallDirectory= /cygdrive/c/cygwin64/usr/uTrace_ServerMachine
JAVA_HOME = /cygdrive/c/Java_JDK_SE_8_u77_64_bit
PATH = /cygdrive/c/Java_JDK_SE_8_u77_64_bit
/ bin:/ usr / local / bin:/ usr / bin:/ cygdrive / c / windows / system32:/ cygdrive / c / ProgramData / Oracle / Java / javapath:/ cygdrive / c / Program Files / Intel / WiFi / bin:/ cygdrive / c / Program Files / Common Files / Intel / WirelessCommon:/ cygdrive / c / WINDOWS:/cygdrive/c/WinZip/WINZIP/WINZIP32.EXE:/ cygdrive / c / Java_JDK_SE_8_u77_64_bit / bin:/ cygdrive /c/Java_JDK_SE_8_u77_64_bit/lib/tools.jar:/cygdrive/c/Java_EE_SDK_7_u2/glassfish4/bin:/cygdrive/c/Java_EE_SDK_7_u2/glassfish4/glassfish/bin:/cygdrive/c/Java_EE_SDK_7_u2/glassfish4/glassfish/lib/javaee。罐子:/cygdrive/c/IBM/Derby/db-derby-10.12.1.1-bin/lib/derbynet.jar:/cygdrive/c/IBM/Derby/db-derby-10.12.1.1-bin/lib/derbytools。罐子:/cygdrive/c/IBM/Derby/db-derby-10.12.1.1-bin/lib/derbyoptionaltools.jar:/cygdrive/c/IBM/Derby/db-derby-10.12.1.1-bin/test/jakarta-奥罗-2.0.8.jar:/cygdrive/c/IBM/Derby/db-derby-10.12.1.1-bin/test/derbyTesting.jar:/cygdrive/c/IBM/Derby/db-derby-10.12.1.1-斌/ lib目录/ derbyrun.jar:/cygdrive/c/IBM/DB2_EX~1/java/db2java.zip:/cygdrive/c/IBM/DB2_EX~1/java/db2jcc.j AR:/cygdrive/c/IBM/DB2_EX~1/java/sqlj.zip:/cygdrive/c/IBM/DB2_EX~1/java/db2jcc_license_cu.jar:/ cygdrive / C / IBM / DB2_EX〜1 /仓:/ cygdrive / c / IBM / DB2_EX~1 / java / common.jar:/ cygdrive / c / ORACLE / NetBeans 8.1 / java / maven / bin:/ cygdrive / c / Program Files(x86)/ Skype / Phone:/ cygdrive / c / Cygwin / bin:/ cygdrive / c / Program Files / Microsoft Network Monitor 3:/ cygdrive / c / My_Software_Development / Client_Monitoring / Client_Scripts
CLASSPATH = / cygdrive / c / cygwin64 / usr / uTrace_ServerMachine /bin/UtraceServer.jar:.;C:\Java_JDK_SE_8_u77_64_bit\lib\tools.jar;C:\Java_EE_SDK_7_u2\glassfish4\glassfish\lib\javaee.jar;C:\IBM\Derby\db-derby-10.12.1.1-仓\ lib中\ derbynet.jar; C:\ IBM \德比\ DB-德比-10.12.1.1槽\ lib中\ derbytools.jar; C:\ IBM \德比\ DB-德比-10.12.1.1槽\ lib中\ derbyoptionaltools.jar; C:\ IBM \德比\ DB-德比-10.12.1.1槽\测试\雅加达口 - 2.0.8.jar; C:\ IBM \德比\ DB-德比-10.12.1.1斌\测试\ derbyTesting.jar; C:\ IBM \德比\ DB-德比-10.12.1.1槽\ lib中\ derbyrun.jar; C:\ IBM \ DB2_EX〜1 \的java \ db2java.zip; C:\ IBM \ DB2_EX 〜1周\的java \的db2jcc.jar; C:\ IBM \ DB2_EX〜1 \的java \ sqlj.zip; C:\ IBM \ DB2_EX〜1 \的java \为db2jcc_license_cu.jar; C:\ IBM \ DB2_EX〜1 \仓; C:\ IBM \ DB2_EX〜1 \的java \ common.jar
错误:无法访问jarfile UtraceServer.jar
jarfile UtraceServer.jar位于/cygdrive/c/cygwin64/usr/uTrace_ServerMachine/bin/UtraceServer.jar 正如您所看到的那样,它位于CLASSPATH中。 感谢任何帮助。
答案 0 :(得分:0)
Java不是Cygwin应用程序,所以它无法理解它 PATH也不是cygdrive后缀。
JAVA_HOME = /cygdrive/c
/ Java_JDK_SE_8_u77_64_bit
PATH = if('posts.html') {
//do something
} else
if (home.html) {
///do somthing else
}
/ Java_JDK_SE_8_u77_64_bit