How to change Java runtime environment for Tomcat in Eclipse
- Details
- Written by Nam Ha Minh
- Last Updated on 07 August 2019   |   Print Email
Eclipse/Tomcat version | JRE version |
Eclipse Juno 4.2.2 | JRE 7 |
Tomcat v6.0 | JRE 6 |
1. Specify JRE version when adding new Tomcat instance
Right click in Servers view, select New > Server:
Select Tomcat v6.0 Server and click Next. In the next screen, specify Tomcat installation directory and choose specific JRE version under the JRE dropdown list:
Pick a desired JRE version, and then click Next or Finish. When starting Tomcat in Eclipse, we can spot the JRE version used in the Console view as follows:
2. Specify JRE version for an existing Tomcat instance
In this way, select Window > Preferences (or shortcut: Alt + W + P) from Eclipse’s main menu. In the Preferences dialog, expand the branch Server > Runtime Environments, select a Tomcat version in the Server runtime environments list, and click Edit button:
The dialog Edit Server Runtime Environment appears:
Pick a JRE version from the JRE dropdown list just like in the first way.If you want to add a new JRE, click the Installed JREs button, and follow the steps described in this article: Managing JRE installations in Eclipse.Related Tutorials:
Other Eclipse Tutorials:
- How to use Eclipse IDE for Java EE Developers
- How to create, build and run a Java Hello World program with Eclipse
- How to generate Javadoc in Eclipse
- How to create WAR file for Java web application in Eclipse
- How to create JAR file in Eclipse
- How to pass arguments when running a Java program in Eclipse
- How to create Java web project with Maven in Eclipse
- 25 Eclipse Shortcut Keys for Code Editing
- How to add custom Ant build script to Eclipse project
- How to Add Copyright License Header for Java Source Files in Eclipse
About the Author:
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.
Comments