7

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

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.8 as default eclipse is not working fine.

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.

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

Prabhat Yadav
  • 1,181
  • 6
  • 18
  • 29
  • 4
    If you only need Java 7 for building a Project, you can Change the Java Version inside of your eclipse/STS for only this Project in the Project properties – Jens Sep 29 '16 at 05:23
  • 1
    See http://stackoverflow.com/questions/12588537/how-to-change-jdk-version-for-an-eclipse-project for more informations – Jens Sep 29 '16 at 05:24

5 Answers5

8

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.

meowsephine
  • 372
  • 1
  • 3
  • 15
7

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.

-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
Sumiya
  • 317
  • 4
  • 5
  • Splitting hairs here, but shouldn't `C:/Program Files/Java/jdk1.8.0_131/bin/javaw.exe` be `C:\Program Files\Java\jdk1.8.0_131\bin\javaw.exe`? Back slashes, not forward slashes. – JeremyCanfield Jul 08 '19 at 17:35
  • You are not splitting hairs JeremyCanfield, both should work. I think I am just used to forward slashes to avoid escaping characters. – Sumiya Jul 08 '19 at 17:58
3

Screenshot

I just set the jdk in the alternative jre value .

Lucky
  • 16,787
  • 19
  • 117
  • 151
Prabhat Yadav
  • 1,181
  • 6
  • 18
  • 29
1

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.

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.

I hope it helps.

Lucky
  • 16,787
  • 19
  • 117
  • 151
Rakesh Prajapati
  • 1,078
  • 8
  • 17
0

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.

Another option: if you have installed Eclipse 4.5, please visit 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.
Beck Yang
  • 3,004
  • 2
  • 21
  • 26