在Ubuntu上安装Java 7 [英] Installing Java 7 on Ubuntu

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

问题描述

安装java我总是使用终端的经典方式。
我想手动安装java。
我将JDK的文件夹放在桌面上,然后设置环境变量(PATH,CLASSPATH和JAVA_HOME)。
从终端,如果我输入 java -version 我会打印

to install java I have always used the classic way from the terminal. I would like to install java manually. I placed the folder of the JDK on the desk and I set environment variables (PATH, CLASSPATH and JAVA_HOME). From the terminal, if I type java -version I get printed

foralobo@ubuntu-vincy:~$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

但是当我尝试安装eclipse或netbeans,系统警告说机器上没有安装java。

But when I try to install eclipse or netbeans, the system warns by saying that there is no java installed on the machine.

完成手动安装缺少什么?
(Ubuntu 13.04)

What is missing to compleatare manual installation? (Ubuntu 13.04)

推荐答案


这个答案用于描述如何安装Oracle Java 7.自Oracle终结Java 7以来,这已不再适用,并且将带有安全补丁的版本的二进制下载放在付费专区之后。此外,OpenJDK已经成长,现在是一种更可行的替代方案。

This answer used to describe how to install Oracle Java 7. This no longer works since Oracle end-of-lifed Java 7 and put the binary downloads for versions with security patches behind a paywall. Also, OpenJDK has grown up and is a more viable alternative nowadays.

在Ubuntu 16.04及更高版本中,Java 7不再可用。通常你最好安装Java 8(或9)。

In Ubuntu 16.04 and higher, Java 7 is no longer available. Usually you're best off installing Java 8 (or 9) instead.

sudo apt-get install openjdk-8-jre

或者,如果您还想要编译器,请获取jdk:

or, f you also want the compiler, get the jdk:

sudo apt-get install openjdk-8-jdk

在Trusty中,目前安装Java 7的最简单方法是安装OpenJDK软件包:

In Trusty, the easiest way to install Java 7 currently is to install OpenJDK package:

sudo apt-get install openjdk-7-jre

或者,对于jdk:

sudo apt-get install openjdk-7-jdk

如果您在不再支持Ubuntu的Ubuntu版本上专门寻找Java 7,请参阅 https://askubuntu.com/questions/761127/how-do-i-install-openjdk-7-on-ubuntu-16-04-or-higher

If you are specifically looking for Java 7 on a version of Ubuntu that no longer supports it, see https://askubuntu.com/questions/761127/how-do-i-install-openjdk-7-on-ubuntu-16-04-or-higher .

这篇关于在Ubuntu上安装Java 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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