如何安装java7和java 8? [英] How to Install both java7 and java 8?

查看:180
本文介绍了如何安装java7和java 8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在windows7机器上安装java7和java8。

How to install both java7 and java8 in windows7 machine.

如果是,那么从java7到java8的顺序和任何开关选项是什么?

If Yes then what is the order and any switch options from java7 to java8 ?

推荐答案

您可以在计算机上安装任意数量的 JDK 实例(并在项目中使用它们)或工具),但只有一个可以作为主要使用 JAVA_HOME env变量,并且应该添加 bin dir到 PATH 的值,如%JAVA_HOME%\ bin

You can install any number of JDK instances on your computer (and use them in projects or tools), but only one can be used as the main with JAVA_HOME env variable and its bin dir should be added to the PATH value like %JAVA_HOME%\bin.

JAVA_HOME 位置来检测 JDK 位置和二进制文件目录> PATH 允许您在终端或直接电话中使用 JDK 等应用,例如 javac 从任何地方

JAVA_HOME location is used by most software to detect default JDK location and binaries dir in PATH allows you to use JDK apps like javac in the terminal or by direct calls from anywhere

如果一切正确,那么您应该在终端中看到所需的java版本,只需输入:

If everything is correct then you should see desired java version in terminal just typing:

C:\Users\Admin>%JAVA_HOME%/bin/java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)   

Linux,Mac OS X或Win安装略有不同,但您可以在 Oracle网站

Linux, Mac OS X or Win installations slightly differ from each other, but you can find all the necessary instructions at the Oracle site.

这篇关于如何安装java7和java 8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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