我下载了 jdk 1.6 并放在 /usr/java 中。当尝试提供 java -version 时,上面的脚本 (libgcj-java-placeholder.sh) 被调用,并显示以下行
This script is a placeholder for the /usr/bin/java and /usr/bin/javac master links required by jpackage.org conventions. libgcj's rmiregistry, rmic and jar tools are now slave symlinks to these masters, and are managed by the alternatives(8) system. This change was necessary because the rmiregistry, rmic and jar tools installed by previous versions of libgcj conflicted with symlinks installed by jpackage.org JVM packages.
如何解决这个问题?
答案1
找到了!/usr/bin 中的符号链接指向错误路径。删除了这些链接并创建了指向我的 java 文件夹的新链接。
使用的命令:
mv java java_old
mv javac javac_old
ln -s /usr/java/jdk1.6.0_43/bin/java java
ln -s /usr/java/jdk1.6.0_43/bin/javac javac
java -version