ant无法在带有openjdk 11的redhat7上运行

vwoqyblh  于 2021-06-29  发布在  Java
关注(0)|答案(0)|浏览(274)

ant使用java 1.8运行正常,但是使用java\u home和使用openjdk 11的path,我得到:

ant --execdebug
exec "/usr/local/java/adopt/jdk-11+28/bin/java" -classpath "/usr/bin/build-classpath: Unable to determine Java version" -Dant.home="/usr/share/ant" -Dant.library.dir="/usr/share/ant/lib" org.apache.tools.ant.launch.Launcher -cp ""
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher

在我看来,构建类路径无法解析版本信息:

sh -x /usr/bin/build-classpath ../jvm/java/lib/tools
+ '[' -r /usr/share/java-utils/java-functions ']'

...

++ echo /usr/local/java/adopt/jdk-11+28
++ sed -n 's+/usr/local/java/adopt/\([-_[:alnum:].]*\)\(.*\)+\1+p'
+ JVM_LIBDIR=/usr/local/java/adopt-exports/jdk-11
+ re='\([[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\(\.[[:digit:]]\{1,\}\)*\)'
+ for option in -fullversion -version
++ /usr/local/java/adopt/jdk-11+28/bin/java -fullversion
++ sed -n -e '/\(openjdk\|java\) \(full \)*version "/s/\([[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\(\.[[:digit:]]\{1,\}\)*\)/<<<\1>>>/' -e '/\(openjdk\|java\) \(full \)*version "/s/.*<<<\([^>]\{1,\}\)>>>.*/\1/p'
+ version=
+ '[' -n '' ']'
+ for option in -fullversion -version
++ /usr/local/java/adopt/jdk-11+28/bin/java -version
++ sed -n -e '/\(openjdk\|java\) \(full \)*version "/s/\([[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\(\.[[:digit:]]\{1,\}\)*\)/<<<\1>>>/' -e '/\(openjdk\|java\) \(full \)*version "/s/.*<<<\([^>]\{1,\}\)>>>.*/\1/p'
+ version=
+ '[' -n '' ']'
+ '[' -z '' ']'
+ echo '/usr/bin/build-classpath: Unable to determine Java version'
/usr/bin/build-classpath: Unable to determine Java version

我需要更新的构建claaspath还是其他什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题