Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify custom JRE path for Apache Tomcat in Intellij IDEA?

The question is how to specify custom JRE path for Apache tomcat in Intellij IDEA (when starting an application from IDEA)?

It seems, that just configuring its path (path to jvm.dll) in Apache Tomcat monitor doesn't help. Are any other ideas or ways how to do this?

like image 776
Andremoniy Avatar asked Nov 20 '13 07:11

Andremoniy


People also ask

Where is JRE path in IntelliJ?

From the main menu, select Help | Find Action or press Ctrl+Shift+A . Find and select the Choose Boot Java Runtime for the IDE action. Select the desired runtime and click OK. If necessary, you can change the location where IntelliJ IDEA will download the selected runtime.

How can I change Java path in Tomcat?

We can change the JRE for Tomcat by setting the JRE_HOME variable in a script file called setenv. bat (on Windows) or setenv.sh (on *nix). This file does not exist by default, so create such file and place it under CATALINA_BASE\bin directory (CATALINA_BASE is the Tomcat installation directory).

Can Tomcat run on JRE?

Tomcat has Eclipse Java Compiler bundle so it can run on JRE and still support JSP.


1 Answers

Right way is:

  1. Go to run configuration of Tomcat launching in IDEA
  2. Select "Startup/Connection" tab
  3. Select desired run mod ("Run"/"Debug"/....)
  4. add new enviroment variable:

"JRE_HOME" with path to needed JRE.

See picture below:

enter image description here

like image 110
Andremoniy Avatar answered Oct 04 '22 04:10

Andremoniy