How To Manually Install Oracle Java on Ubuntu
Introduction
Java is a programming technology originally developed by Sun Microsystems and later acquired by Oracle. Oracle Java is a proprietary implementation for Java that is free to download and use for commercial use, but not to redistribute, therefore it is not included in a officially maintained repository.
There are many reasons why you would want to install Oracle Java over OpenJDK. In this tutorial, we will not discuss the differences between the above mentioned implementations.
Assumptions
This tutorial assumes that you have an account with DigitalOcean, as well as a Droplet running Debian 7 or Ubuntu 12.04 or above. You will need root privileges (via sudo) to complete the tutorial.
You will need to know whether you are running a 32 bit or a 64 bit OS:
i46614161@i46614161:/usr/local/java/jdk1..0_05$ uname -m
i686
x86_64: 64 bit kernel
i686: 32 bit kernel
Downloading Oracle Java JDK
Using your web browser, go to the Oracle Java SE (Standard Edition) website and decide which version you want to install:
JDK: Java Development Kit. Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications.
Server JRE: Java Runtime Environment. For deploying Java applications on servers. Includes tools for JVM monitoring and tools commonly required for server applications.
In this tutorial we will be installing the JDK Java SE Development Kit 8 x64 bits. Accept the license and copy the download link into your clipboard. Remember to choose the right tar.gz (64 or 32 bits). Use wget to download the archive into your server:
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-i586.tar.gz
Oracle does not allow downloads without accepting their license, therefore we needed to modify the header of our request. Alternatively, you can just download the compressed file using your browser and manually upload it using a SFTP/FTP client.
Always get the latest version from Oracle's website and modify the commands from this tutorial accordingly to your downloaded file.
Or U can visit the website directly and download the tar.gz file do not visa the command .
Installing Oracle JDK
In this section, you will need sudo privileges:
sudo
sudo mkdir -p /usr/local/java
cd /home/"your_user_name"/Downloads
sudo cp -r jdk-8u5-linux-i586.tar.gz /usr/local/java/
cd /usr/local/java
sudo tar xvzf jdk-8u5-linux-i586.tar.gz
Setting Oracle JDK as the default JVM
In our case, the java executable is located under /usr/local/java/jdk1.8.0_05/bin/java . To set it as the default JVM in your machine run:
sudo update-alternatives --install /usr/bin/java java /usr/local/java/jdk1..0_05/bin/java 100
sudo update-alternatives --install /usr/bin/javac javac /usr/local/java/jdk1.8.0_05/bin/javac 100
sudo update-alternatives --install /usr/bin/javaws javaws /usr/local/java/jdk1..0_05/bin/javaws
Verify your installation
Verify that java has been successfully configured by running:
update-alternatives --display java
update-alternatives --display javac
The output should look like this:
java - auto mode
link currently points to /usr/local/java/jdk1..0_05/bin/java
/usr/local/java/jdk1..0_05/bin/java - priority
Current 'best' version is '/usr/local/java/jdk1.8.0_05/bin/java'.
javac - auto mode
link currently points to /usr/local/java/jdk1..0_05/bin/javac
/usr/local/java/jdk1..0_05/bin/javac - priority
Current 'best' version is '/usr/local/java/jdk1.8.0_05/bin/javac'.
Another easy way to check your installation is:
java -version
After installation is complete, set environment variables as follows
- Edit the system Path file /etc/profile
sudo gedit /etc/profile
- Add following lines in end
JAVA_HOME=/usr/local/java/jdk1..0_05
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export PATH
Note:The environment variables modifiy will active after you logout or reboot system .
How To Manually Install Oracle Java on Ubuntu的更多相关文章
- How to Install Oracle Java 11 on Ubuntu 18.04 LTS (Bionic) Written by Rahul, Updated on April 3, 20
本文系转载备份 请阅读点击下面链接阅读原文以获取更佳地阅读体验.谢谢. How to Install Oracle Java 11 on Ubuntu 18.04 LTS (Bionic) Writt ...
- HOWTO install Oracle 11g on Ubuntu Linux 12.04 (Precise Pangolin) 64bits
安装了Ubuntu 12.04 64bit, 想在上面安装Oracle 11gr2,网上找了好多文档都没成功,最后完全参考了MordicusEtCubitus的文章. 成功安装的关键点:install ...
- centos yum install oracle java
How to install Java on CentOS 7 | Linuxizehttps://linuxize.com/post/install-java-on-centos-7/ CentOS ...
- Install Oracle Java JDK/JRE 7u55 on Fedora 20/19, CentOS/RHEL 6.5/5.10
What’s new in Sun/Oracle Java 7 VM Compressed 64-bit object pointers Garbage-First GC (G1) JSR 292: ...
- oracle java for ubuntu apt-get
oracle java PPA: ppa:webupd8team/javathe key word use for search more infomation: webupd8team
- [转]How to Install Oracle Java 11 in Ubuntu 18.04/18.10
链接地址:http://ubuntuhandbook.org/index.php/2018/11/how-to-install-oracle-java-11-in-ubuntu-18-04-18-10 ...
- install sun java in ubuntu
1. 下载: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 2. 解压安装: ...
- ubuntu安装oracle java
通常UBUNTU源中带有openjava,但在使用eclipse与android studio时经常会有莫名奇妙的问题,所以个人觉得还是用oracle java,省点心. 安装步骤如下: sudo a ...
- 在Ubuntu 18.04中安装Oracle Java JDK 8
Webupd8 Team维护一个PPA存储库,其中包含适用于所有当前Ubuntu版本的Oracle Java 8安装程序脚本. 1.打开终端并运行命令添加PPA: sudo add-apt-repos ...
随机推荐
- java并发编程:线程安全管理类--原子包--java.util.concurrent.atomic
java.util.concurrent.atomic 的描述 AtomicBoolean 可以用原子方式更新的 boolean 值. AtomicInteger 可以用原子方式更新的 int 值. ...
- delphi从dll中调用图片资源
假定你的一个dll中有bmp图片,其中图片的别名为'img'(如何将图片放入dll中百度上有图文教程) 当想将dll中的bmp导出时,可以用如下实例代码: procedure TForm1.FormC ...
- 记录下返回list给前端 遇到 $ref":"$.data.*** 问题
1.通过对象返回给前端,对象里面有三个list 2.一个父list 2个子list 子list中的对象 是通过for循环父list按照某个条件放进去的 3.直接放进去会出现 $ref":& ...
- JAVA实现Excel导入/导出【转】
JAVA实现Excel导入/导出[转] POI的下载与安装 请到网站http://www.apache.org/dyn/closer.cgi/poi/右击超链接2.5.1.zip下载压缩包poi-bi ...
- 怎样使用visio画数据库模型图
怎样使用visio画数据库模型图 计算机专业的学生在做程序的需求分析文档或者毕业设计的时候,针对自己开发的系统,肯定少不了要画数据库的模型图.许多同学喜欢用word实现,当然,word可以满足 ...
- POI2014题解
POI2014题解 [BZOJ3521][Poi2014]Salad Bar 把p当作\(1\),把j当作\(-1\),然后做一遍前缀和. 一个合法区间\([l,r]\)要满足条件就需要满足所有前缀和 ...
- centos7 开放mongodb端口
CentOS 7 默认没有使用iptables,所以通过编辑iptables的配置文件来开启端口是不可以的 CentOS 7 采用了 firewalld 防火墙 如要查询是否开启27019端口则: 1 ...
- vs2013 乱码问题
单击一下代码框 然后点文件 有个高级保存选项 改成utf-8 就可以显示中文了
- vim自定义配置之UI设置
vimConfig/plugin/ui-setting.vim let os = substitute(system('uname'), "\n", "", & ...
- php 面试一般都遇到什么问题
大型互联网公司会从几个方面来考核:第一:专业上,专业分为五个方向,操作系统,网络,算法,语言,数据库,一般情况下,会比较在乎Linux系统的日常使用,包括shell脚本,比较深入的话,会问kernel ...