Install Oracle Java JDK 7 in Ubuntu 12.04 (Precise Pangolin)

本文详细介绍了如何在Ubuntu 12.04系统中手动安装Oracle Java JDK 7,包括下载安装包、创建文件夹、配置环境变量等步骤,并确保了浏览器插件的兼容性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Last week we showed you how to install Oracle Java Runtime Environment (JRE) in Ubuntu 12.04. To read that post, click here.

In today’s post, I’m going to show you how to install Oracle Java (JDK) 7 in Ubuntu as well. There are some blogs that will show you how to install it via PPA, which is much easier, but then most PPA sources are not reliable. One day they’re up and the next they’re gone. This method is the surefire way to install Java JDK in Ubuntu.

Objectives:

  • Install Java JDK in Ubuntu 12.04 (Precise Pangolin)
  • Enjoy!

To get started, download Java JDK package from here.

When prompted with the screen below, choose to save the file.

 

jdk_precise

 

After saving, extract the downloaded package by running the commands below. This assumes that the package was downloaded in your Downloads folder.

tar -xvf ~/Downloads/jdk-7u3-linux-i586.tar.gz

 

jdk_precise_1

 

Next, create a folder for Java JDK files and folders by running the commands below.

sudo mkdir -p /usr/lib/jvm/jdk1.7.0 

 

jdk_precise_2

 

Then move all the JDK files and folders to the new location by running the commands below.

sudo mv jdk1.7.0_03/* /usr/lib/jvm/jdk1.7.0/

 

jdk_precise_3

 

Next, copy and paste each command as shown below one-at-a-time to enable Java JDK. Remember to press Enter after each line.

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1 sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1

 

Then create a Mozilla plugins folder in your home directory.

mkdir ~/.mozilla/plugins/

 

jdk_precise_7

 

Finally, create a symbolic link to your Mozilla plugins folder. For 64-bit systems, replace ‘i386’ with ‘amd64’.

ln -s /usr/lib/jvm/jdk1.7.0/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/

 

jdk_precise_8

 

That’s it! Enjoy!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值