3 回答
TA贡献1863条经验 获得超2个赞
这是我的错误。
这就是我通过命令行创建 CLASSPATH 的方式
export CLASSPATH=/home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/*
我创建的目录不是ApacheTomcat,而是Apache Tomcat(中间有一个空格)。
也许这就是 CLASSPATH 变量无法识别正确位置的原因。
我将目录名称更改为 ApacheTomcat(删除了空格)。
现在我在 .bashrc 文件中定义了 CLASSPATH 变量,如下所示:
#classpath
export CLASSPATH=/home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/*
现在,当我执行 echo${CLASSPATH} 时,我得到了我提到的所有 jar 文件。
nithinchandranp@b-40:~$ echo ${CLASSPATH}
/home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/annotations-api.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/catalina-ant.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/catalina-ha.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/catalina.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/catalina-storeconfig.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/catalina-tribes.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/ecj-4.6.3.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/el-api.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/jasper-el.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/jasper.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/jaspic-api.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/jsp-api.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/servlet-api.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-api.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-coyote.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-dbcp.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-i18n-es.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-i18n-fr.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-i18n-ja.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-i18n-ru.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-jdbc.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-jni.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-util.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-util-scan.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/tomcat-websocket.jar /home/nithinchandranp/ApacheTomcat/apache-tomcat-8.5.34/lib/websocket-api.jar
添加回答
举报