如何在 Java 1.7 版上运行 STS

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39761992/
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-08-11 21:26:13  来源:igfitidea点击:

How to run STS on Java version 1.7

javaeclipsespringspring-tool-suiteubuntu-14.10

提问by Prabhat Yadav

I need to run eclipse(java 1.7) and STS 3.8.1 ( java 1.8) but if i select the java 7 as default i am getting error in the STS 3.8.1. I am using OS : ubuntu 14.10

我需要运行 eclipse(java 1.7) 和 STS 3.8.1 (java 1.8) 但如果我选择 java 7 作为默认值,我会在 STS 3.8.1 中遇到错误。我在用OS : ubuntu 14.10

Error  : Version 1.7.0_80 of the JVM is not suitable for this product. Version: 1.8 or greater is required.

Or I select java 1.8as default eclipse is not working fine.

或者我选择java 1.8作为默认 eclipse 工作不正常。

My requirement is to build a Project using java 1.7 with STS.and latest version 3.8.1 doesnot support the java 1.7.

我的要求是使用java 1.7 with STS.最新版本 3.8.1 不支持 java 1.7来构建项目。

and i try to search which version of STS support 1.7but i am not getting any answer .

我尝试搜索哪个version of STS support 1.7但我没有得到任何答案。

采纳答案by Prabhat Yadav

Screenshot

截屏

I just set the jdk in the alternative jre value .

我只是在替代 jre value 中设置 jdk 。

回答by Beck Yang

The STS 3.8.1 all-in-one distribution is based on Eclipse v4.6 which required Java 1.8 to start it. As @Jens mentioned, you can to Open Windows-> Preferences. Then open tree node Java> Installed JREs. After adding a new JRE/JDK, you can set it as default or delete others items.

STS 3.8.1 多合一发行版基于 Eclipse v4.6,需要 Java 1.8 才能启动它。正如@Jens 提到的,您可以打开Windows-> Preferences。然后打开树节点Java> Installed JREs。添加新的 JRE/JDK 后,您可以将其设置为默认值或删除其他项。

Another option: if you have installed Eclipse 4.5, please visit https://spring.io/tools/sts/all

另一种选择:如果您已经安装了 Eclipse 4.5,请访问https://spring.io/tools/sts/all

  1. Install STS 3.8.1 via Update Sites: open Help-> Install New Software.... Just paste update site URL in the Wizard.
  2. If you prefer install it offline, you can download STS Update Site Archives. Clicking the Add...button in the same Wizard, select the folder of unpacked zip file.
  1. 通过更新站点安装 STS 3.8.1 :打开Help-> Install New Software...。只需在向导中粘贴更新站点 URL。
  2. 如果您更喜欢离线安装,您可以下载 STS Update Site Archives。单击Add...同一向导中的按钮,选择解压后的 zip 文件所在的文件夹。

回答by meowseph_furbalin

This question is old, but for anyone looking at this in the future who can't install Java 8 or otherwise can't use the workaround in the other answer - 3.8.0 was the first version requiring Java 1.8, while 3.7.3 still plays nice with only Java 1.7.

这个问题很旧,但是对于将来无法安装 Java 8 或无法使用其他答案中的解决方法的任何人来说 - 3.8.0 是第一个需要 Java 1.8 的版本,而 3.7.3 仍然只有 Java 1.7 才能很好地发挥作用。

回答by Rakesh Prajapati

It is asking for jdk 1.8 to open and run the STS (eclipse). It will still allow you to build your project/code with whatever JDK version you want.

它要求 jdk 1.8 打开并运行 STS (eclipse)。它仍然允许您使用您想要的任何 JDK 版本构建您的项目/代码。

Install jdk1.8, set your JAVA_HOME and PATH env variables so that 1.8 becomes your default jdk. After this your should be able to open STS. Then setup project and set project's JDK to 1.7 or whatever you want.

安装 jdk1.8,设置您的 JAVA_HOME 和 PATH 环境变量,以便 1.8 成为您的默认 jdk。在此之后,您应该能够打开 STS。然后设置项目并将项目的 JDK 设置为 1.7 或任何你想要的。

I hope it helps.

我希望它有帮助。

回答by behold

If you came to this page because you searched for the same error but wanted a different option, you can try updating the STS.ini configuration settings (e.g. at /sts-win32-x86_64/sts-bundle/sts-3.9.3.RELEASE/ folder) with two lines at the top as follows. The second line is path to your Java 8 installation.

如果你来到这个页面是因为你搜索了同样的错误但想要一个不同的选项,你可以尝试更新 STS.ini 配置设置(例如在 /sts-win32-x86_64/sts-bundle/sts-3.9.3.RELEASE / 文件夹),顶部有两行,如下所示。第二行是 Java 8 安装路径。

-vm
C:/Program Files/Java/jdk1.8.0_131/bin/javaw.exe

Original:

原文

-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.551.v20171108-1834
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM
-Xms40m
-Dosgi.module.lock.timeout=10
-Dorg.eclipse.swt.browser.IEVersion=10001
-Xmx1200m

Updated:

更新

-vm
C:/Program Files/Java/jdk1.8.0_131/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.551.v20171108-1834
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM
-Xms40m
-Dosgi.module.lock.timeout=10
-Dorg.eclipse.swt.browser.IEVersion=10001
-Xmx1200m