Maven的:无法找到OS X java.lang中的问题(Maven : unable to fi

2019-07-29 19:54发布

我提示以下问题时,我试图mvn clean install显然是无法找到的运行时间罐子,但我需要做什么?

错误日志:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
[parsing started /Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/src/main/java/com/ericsson/research/ag/ra/common/cthserverclient/IHttpClient.java]
[parsing completed 42ms]
[parsing started /Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/src/main/java/com/ericsson/research/ag/ra/common/cthserverclient/CTHWebSessionException.java]
[parsing completed 1ms]
[parsing started /Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/src/main/java/com/ericsson/research/ag/ra/common/cthserverclient/CTHServerSession.java]
[parsing completed 14ms]
[search path for source files: /Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/src/main/java,]
[search path for class files: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/rt.jar,/Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/target/classes,/Users/olgunkaya/.m2/repository/json/json-simple/1.1/json-simple-1.1.jar,.]
Fatal Error: Unable to find package java.lang in classpath or bootclasspath

[INFO] 1error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.696s
[INFO] Finished at: Mon Jun 11 07:54:00 EEST 2012
[INFO] Final Memory: 5M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3:compile > (default-compile) on project ag.ra.common: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] [parsing started /Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/src/main/java/com/ericsson/research/ag/ra/common/cthserverclient/IHttpClient.java]
[ERROR] [parsing completed 42ms]
[ERROR] [parsing started /Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/src/main/java/com/ericsson/research/ag/ra/common/cthserverclient/CTHWebSessionException.java]
[ERROR] [parsing completed 1ms]
[ERROR] [parsing started /Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/src/main/java/com/ericsson/research/ag/ra/common/cthserverclient/CTHServerSession.java]
[ERROR] [parsing completed 14ms]
[ERROR] [search path for source files: /Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/src/main/java,]
[ERROR] [search path for class files: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/rt.jar,/Users/olgunkaya/workspace/CM2H/remoteaccess/osgi/ag.ra.common/target/classes,/Users/olgunkaya/.m2/repository/json/json-simple/1.1/json-simple-1.1.jar,.]
[ERROR] Fatal Error: Unable to find package java.lang in classpath or bootclasspath

Answer 1:

我想我找到了问题。

苹果已经改变了的rt.jar到classes.jar位于英寸

/System/Library/Frameworks/JavaVM.framework/Versions/ <your_java_version> /Classes/classes.jar

我需要修改我的pom.xml,以显示它classes.jar的路径。

编辑:在多mudule项目。 lib目录中创建软链接到类罐子要好得多。

sudo ln -s ../../Classes/classes.jar ./rt.jar

那么sudo ,因为结果写/usr/libexec/java_home命令,这是你的java主目录,需要管理员priviligies。



文章来源: Maven : unable to find java.lang issue on OS X