how to configure run/debug in Idea 3.0, use java instead of javaw

If I create and run/debug a new application, it is always started with javaw.exe.
Is it possible to change this to java.exe?
Thanks for your answers

0
2 comments

As far as I recall, Idea has always used java.exe to run apps, as can be
seen in the output tab.

I don't recall 3.0 being different and using javaw instead..


0

Unfortunately we don't have such feature in Intellij.
For now, the only alternative is to explicitly run your -jar file with “javaw.exe” with “Before Launch task”:

// On Windows
1. Create bat file in a project directory with the following content:

@ECHO OFF
set JAVA_CMD="C:\Users\Desctop\.jdks\path_to_your_jdk\bin\javaw.exe"
%JAVA_CMD% %*

2.  “Edit Run/Debug configurations” → “Modify Options” → “Add before Launch Task” → “Add  Run External Tool”
3. Add new External Tool:

Program: “absolute path to your .bat file” D:\projects\program\local-run.bat
Arguments: “path to your jar” -jar target/your-jar-1.0-SNAPSHOT.jar

Or you can execute the command explicitly in your bat file:

@ECHO OFF
C:\Users\Desctop\.jdks\graalvm-jdk-17.0.11+7.1\bin\javaw.exe  -jar target/my-jar-1.0-SNAPSHOT.jar
0

Please sign in to leave a comment.