0

I recently compiled my code using Java 1.8. I had set JAVA_HOME and PATH to do the compilation using ant

Now, When I start Eclipse (Luna), in order to debug application using Tomcat plugin for eclipse. I starts using below path - using Java 1.7

enter image description here

And tomcat starts and prints below

Apr 10, 2018 4:25:34 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            6.3
Apr 10, 2018 4:25:34 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Apr 10, 2018 4:25:34 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME:             C:\Program Files\Java\jre7
Apr 10, 2018 4:25:34 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.7.0_79-b15

How can I use Java 1.8 in this ?

SimpleGuy
  • 2,764
  • 5
  • 28
  • 45

3 Answers3

2

Right click on the project > Java Build Path > Libraries

Remove java 1.7 library and "Add Library..." for java 1.8

Amitabha Roy
  • 769
  • 5
  • 8
1

Proceed to the Tomcat server instance configuration and set Tomcat Runtime Environment JRE to "Workbench Default JRE". see the pic

Alex Sergeenko
  • 642
  • 5
  • 22
  • This should be a comment not an answer – prgrm Apr 10 '18 at 11:45
  • I don't find any such setting. Can you tell me how to navigate to that ? – SimpleGuy Apr 10 '18 at 11:56
  • @SimpleGuy At first ensure that you're using Java EE perspective in Eclipse, in other case switch to it. Then go to the 'Servers' tab, double click on your tomcat instance, the 'Overview' windows will appear, click a link "Runrime Environment" and in the appeared window 'Edit Server Runtime Environment' choose a JRE from drop-down list. Hope it'll work. – Alex Sergeenko Apr 10 '18 at 12:13
0

Window -> Preferences -> Java -> Installed JREs

glove40
  • 45
  • 6