Installing Oracle Java 7 On Ubuntu version 12.04 or 13.04+
The good news is you can install Oracle Java 7 easily and make it as the default source implementation of the Java platform. First, grab Oracle Java 7 directly from Oracle Java download page:
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Make sure you download 32 bit (Linux x86 ~ jdk-7u21-linux-i586.tar.gz) or 64 bit (Linux x64 ~ jdk-7u21-linux-x64.tar.gz) JDK version in .tar.gz format:
Fig.05: Accept Oracle license and download either 64 or 32 bit version in tar.gz format
Note: By default all files are downloaded in ~/Download/ ($HOME/Download/) directory.
Install jdk-7u21-linux-x64.tar.gz
Open a terminal and type the following command to list your files:
ls ~/Downloads/*.tar.gz
Sample outputs:
/home/nixcraft/Downloads/jdk-7u21-linux-x64.tar.gz
Untar the tar ball and install at /usr/lib/jvm/ directory:
sudo mkdir -p /usr/lib/jvm/
sudo tar xvf ~/Downloads/jdk-7u21-linux-x64.tar.gz -C /usr/lib/jvm
- Now run
-
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo 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
- This will assign Oracle JDK a priority of 1, which means that installing other JDKs will replace it as the default. Be sure to use a higher priority if you want Oracle JDK to remain the default.
- Correct the file ownership and the permissions of the executables:
-
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/jdk1.7.0
N.B. remember - Java JDK has many more executables that you can similarly install as above. java
,javac
, javaws
are probably the most frequently required.
This answer lists the other executables available.
- Run
sudo update-alternatives --config java
You will see output similar one below - choose the number of jdk1.7.0 - for example 3
in this list:
$sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
————————————————————
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
3 /usr/lib/jvm/jdk1.7.0/jre/bin/java 3 manual mode
Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jdk1.7.0/jre/bin/java to provide /usr/bin/java (java) in manual mode.
Check the version of you new JDK 7 installation:
java -version
java version “1.7.0”
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode)
Repeat the above for:
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
相关推荐
oraclejava::install 或者 class { 'oraclejava::install': } 默认行为是安装具有无限 JCE 的 java8。 它不会自动升级。 如果你想升级java8,你可以使用ensure参数: class { 'oraclejava::install': ensure => '...
在Ubuntu10下安装oracle10g-Help you install oracle10g on the system ubuntu10
书名:A practical guide to ubuntu linux 作者:Mark S. Sobell 带书签 高清版
Oracle-java8 在容器 wnameless/oracle-xe-11g(Ubuntu 16.04 LTS 上的 Oracle Express 11g R2)之上添加 Java8 的容器。 建造 docker build -t oracle-java8 . 跑步 docker run -it --rm oracle-java8 在映射并打开...
Ubuntu Linux操作系统入门指南,使用于初学者了解并入门ubuntu系统的使用
Get hands-on recipes to make the most of Ubuntu Server, CentOS 7 Linux Server and RHEL 7 Server About This Book Get Linux servers up and running in seconds, In-depth guide to explore new features and...
熟练掌握在VMware下安装Linux7.6环境 熟练掌握在Linux环境下安装Oracle19c数据库 熟练掌握Linux环境下对Oracle数据库的运维操作
java8 看不到源码 oracle-java8-ant 在容器 sunithar/oracle-java8(带有 Java8 的 Ubuntu 16.04 LTS ...Oracle ...oracle-java8-ant ...Ubuntu、Oracle、Java8 和 Ant 作为基础镜像的人都可以使用这个容器
Ubuntu部落:初学者推荐.rar
文档内记载了CentOS7和Redhat7系统安装Oracle19C的详细步骤,包括RPM包的安装说明
如果你想进行最新的实验或者开发的话,那么你可以试试在 Linux 系统上安装 Java 14。 Oracle JDK 14(或简称 Java 14)发布版包含几个新功能,如果你想预览它们的话。我已添加了链接: instanceof 的模式匹配 ...
oracle 10g for linux ubuntu server 7.0.4 xming,Xmanage putty 1. Update ubuntu sudo apt-get update sudo apt-get upgrade 2. install the development environment and libraries sudo apt-get ...
安装JDK-Java和Ubuntu的文档文档 1. Java设计 顾问地毯=> basicProgram 。 简介 安装JDK 激光变量配置 创作,创作与创作的共性 2. Java desde consola avanzado 顾问地毯=> semaforo 。 身份识别演员/ Objetos ...
Ubuntu Linux 指南 基础篇+管理篇
这个是江西服装学院考试题目+答案;主要考点在我的博客《Linux考试复兴一波》文章里有介绍
UBUNTU linux学习手册教程集合,常用命令大全,UBUNTU linux从入门到精通。
Ubuntu部落:初学者推荐用书 讲解详细,可供没有基础的人从零学起
看不到源码ansible-java8-oracle 安装 Oracle Java8 webupd8 ppa 的 Ansible 角色。 应该在 Ubuntu 或 Mint 上工作。 Debian 没有 ppa 支持 AFAIK。 许可证是自动接受的(没有提示)并且整个事情是幂等的(多次执行...
sudo apt get install yasm 去官网:http: www ffmpeg org 点击Download进入:http: www ffmpeg org download html 选择linux下的Ubuntu进入:https: launchpad net jon severinsson +archive ubuntu ffmpeg 点击...