3

mvn clean install 明らかに実行時のjarが見つからないので、以下の問題が発生しますが、何をする必要がありますか?

エラーログ:

[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
4

1 に答える 1

11

私は問題を見つけたと思います。

Appleは、rt.jarをにあるclasses.jarに変更しました。

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

pom.xmlを変更して、classes.jarへのパスを表示する必要があります。

編集:マルチミューデュルプロジェクト。libディレクトリにクラスjarへのソフトリンクを作成する方がはるかに優れています。

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

Javaホームディレクトリであるコマンドsudoの結果を書き込むには、管理者権限が必要です。/usr/libexec/java_home

于 2012-06-11T06:29:45.560 に答える