Java 已安装,命令不起作用

Java 已安装,命令不起作用

我已经安装了 java,但无法运行任何 java 命令!下面显示了我尝试运行 java 命令时得到的结果:

sultan@ubuntu:~$ java
The program 'java' can be found in the following packages:
 * default-jre
 * gcj-4.6-jre-headless
 * openjdk-6-jre-headless
 * gcj-4.5-jre-headless
 * openjdk-7-jre-headless
Try: sudo apt-get install <selected package>

sultan@ubuntu:~$ sudo apt-get install openjdk-7-jre
[sudo] password for sultan:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openjdk-7-jre is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

相关内容