我去了SUN的网站并下载了.bin:
我运行它,检查条款,这显示:
Java(TM) SE Development Kit 6 successfully installed. Product Registration is FREE and includes many benefits: * Notification of new versions,patches,and updates * Special offers on Sun products,services and training * Access to early releases and documentation Product and system data will be collected. If your configuration supports a browser,the Sun Product Registration form for the JDK will be presented. If you do not register,none of this information will be saved. You may also register your JDK later by opening the register.html file (located in the JDK installation directory) in a browser. For more information on what data Registration collects and how it is managed and used,see: http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html Press Enter to continue..... Done.
但是,当我在终端中键入“java”时,它会说:
-bash:java:找不到命令
如何检查是否已成功安装?不是你怎么检查?
解决方法
如果您正在运行基于debian的安装,我强烈建议您从存储库中获取JDK.您只需在终端中运行以下命令:
$sudo aptitude install sun-java6-jdk
我不确定其他发行版是否也带有Sun的JDK.你可能会发现openjdk-6-jdk是一个等价的FOSS替代品.
如果您没有包管理器或正在尝试手动安装JDK,我假设您已经从Sun网站获得了正确版本的JDK.您可以在此处找到他们的Java SE下载页面:http://java.sun.com/javase/downloads/index.jsp
如果你已经完成了这一切,那么在终端上运行“java”应该可行.如果没有,则可能意味着它未正确安装,或者只是安装在不在您路径上的位置.
你知道你选择安装它的地方吗?
如果您确定它已安装,但不确定它可能安装在哪里,您可以尝试运行updatedb然后使用locate来查找java运行时:
$sudo updatedb $locate java
这可以让您了解可能需要添加到PATH环境变量的目录.
当然,如果locate返回没有结果,那么可能没有安装JDK.