用 Java 6 替换 Java 7

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10616349/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 01:50:03  来源:igfitidea点击:

Replacing Java 7 with Java 6

javajdk1.6java-7

提问by Rajeshwar

Currently I am running java 7 on Windows 7

目前我在 Windows 7 上运行 java 7

C:\>java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

How can i replace it with Java 6 ?? What is the best way ??

我怎样才能用 Java 6 替换它?什么是最好的方法 ??

采纳答案by James Reeves

Install Java 6 from the Sun website

从 Sun 网站安装 Java 6

Then change the PATH to point to Java 6.

然后将 PATH 更改为指向 Java 6。

Or you could have followed this guide: Java Website

或者您可以遵循本指南:Java 网站

回答by jmruc

You actually don't need to change that - with the latest version (7 at the moment) you can run code compiled for all older versions, AND for the newest version.

您实际上不需要更改它 - 使用最新版本(目前为 7),您可以运行为所有旧版本和最新版本编译的代码。

What you probably want is to compile your code for use with a older version. See the cross-compilation examplehow to do it with the javaccommand, and this questionfor how to do it in eclipse.

您可能想要的是编译您的代码以用于旧版本。请参阅交叉编译示例如何使用javac命令执行此操作,以及有关如何在 Eclipse 中执行此操作的问题