jdk/bin下所有命令无法执行

jdk/bin下所有命令无法执行

例如我jmap在终端中输入,它将显示:

The program 'jmap' can be found in the following packages:
 * openjdk-6-jdk
 * openjdk-7-jdk
Try: apt-get install <selected package>
root@CNS-ETNEXUS1:/usr/lib/jvm# The program 'jmap' can be found in the following packages:
No command 'The' found, did you mean:
 Command 'the' from package 'the' (universe)
The: command not found

类型jstack是类似的结果,。

我关注这个askubuntu 链接安装java7,但是当我收到这台机器时,有人已经安装了一些openjdk,我猜这就是为什么有openjdk选项。

如何修复?我不想每次都使用绝对路径。

echo $PATH

/usr/local/rvm/gems/jruby-1.7.4/bin:/usr/local/rvm/gems/jruby-1.7.4@global/bin:/usr/local/rvm/rubies/jruby-1.7.4/bin:/usr/local/rvm/bin:/usr/share/centrifydc/sbin:/usr/share/centrifydc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/rvm/bin:/usr/local/rvm/bin

谢谢。

答案1

sudo apt-get install openjdk-6-jdk

sudo apt-get install openjdk-7-jdk

相关内容