1

以下の説明に従ってOpenJDKをインストールしました。しかし、私はまだこのエラーを受け取り続けています。bash_profile に正しい PATH を設定しました。

誰かがこれから私を助けてくれますか?

 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-     plugin:2.3.2:compile (default-compile) on project poker-protocol: Compilation failure
 [ERROR] Unable to locate the Javac Compiler in:
 [ERROR] /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/tools.jar
 [ERROR] Please ensure you are using JDK 1.4 or above and
 [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
 [ERROR] In most cases you can change the location of your Java
 [ERROR] installation by setting the JAVA_HOME environment variable.
 [ERROR] -> [Help 1]
 [ERROR] 
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR] 
 [ERROR] For more information about the errors and possible solutions, please read the following articles:
 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
 [ERROR] 
 [ERROR] After correcting the problems, you can resume the build with the command
 [ERROR]   mvn <goals> -rf :poker-protocol

私のbash_profileにはこれがあります:

 JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
 export M2_HOME=/usr/local/apache-maven-3.0.4
 export PATH=${M2_HOME}/bin:${PATH}:$JAVA_HOME/bin

誰かが私を助けることができますか?

4

3 に答える 3

4

Java ランタイムをインストールしましたが、Java アプリケーションを開発するには JDK が必要です。したがって、この場合は OpenJDK devel パッケージをインストールする必要がありますjava-1.6.0-openjdk-devel-1.6.0.0.x86_64

于 2013-01-22T13:19:08.853 に答える
0

それについてはよくわかりませんが、私の場合、このように設定しました:

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_11/
export PATH=$JAVA_HOME/bin:$PATH

私はこれをしましたbash.bashrc

export変数名を指定する前に追加してみてください。私がopenjdkを使用していないと思っていても発見したもう1つのことはtool.jarjreディレクトリではなくディレクトリの下にあることjdkです。

お役に立てれば。

于 2013-01-22T13:15:34.453 に答える