Register JDK as default in Linux

  Installing Sun JDK on Linux Installing Sun JDK on Linux (Fedora Core 3) Downloading Download the latest version of JDK from http://www.java.sun.com . I have downloaded jdk-1_5_0_01-linux-i586.bin for this tutorial. Installing Change to the

Installing Sun JDK on Linux (Fedora Core 3)

Downloading 
Download the latest version of JDK from http://www.java.sun.com. I have downloaded jdk-1_5_0_01-linux-i586.bin for this tutorial.

Installing
Change to the directory where you downloaded the SDK ( I downloaded it in my home directory /home/deepak) and make the self-extracting binary executable:

chmod +x jdk-1_5_0_01-linux-i586.bin

Run the self-extracting binary, this will display the License agreement text and will ask you to accept the agreement:

./jdk-1_5_0_01-linux-i586.bin

Above command should create a directory called jdk1.5.0_01 in the /home/deepak directory. Move the SDK directory to /usr/java/ .Create /usr/java if it doesn't exist. Here is the command used:

mv jdk1.5.0_01 /usr/java

Set the JAVA_HOME environment variable, by modifying /etc/profile so it includes the following:

JAVA_HOME="/usr/java/jdk1.5.0_01"
export JAVA_HOME

/etc/profile is run at startup and when a user logs into the system, so you will need to log out and log back in for JAVA_HOME to be defined.

Check to make sure JAVA_HOME is defined correctly using the command below. You should see the path to your Java SDK.

echo $JAVA_HOME
Output should be
/usr/java/jdk1.5.0_01
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值