Java命令在Linux上没有发现 [英] Java command not found on Linux

查看:180
本文介绍了Java命令在Linux上没有发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Oracle企业级Linux,当我键入的Java 我收到

In Oracle Enterprise Linux when I type java I am getting

bash: java: command not found

我已经安装了Java 1.6和我有以下

I have installed Java 1.6 and I have the following

sudo update-alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
 + 2           /usr/java/jre1.6.0_24/bin/java

我怎样才能解决这个问题?

How can I resolve this issue?

感谢

推荐答案

您可以使用以下命令添加Java路径PATH变量之一。

You can add one of the Java path to PATH variable using the following command.

export PATH=$PATH:/usr/java/jre1.6.0_24/bin/

您可以添加此行.bashrc文件在你的home目录中。添加这的.bashrc将确保每次打开bash中这将是PATH变量将被更新。

You can add this line to .bashrc file in your home directory. Adding this to .bashrc will ensure everytime you open bash it will be PATH variable is updated.

这篇关于Java命令在Linux上没有发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆