Stan Stan - 6 months ago 16
Java Question

Eclipse RCP Application cannot use -vm & -console together?

In my Java application

.ini
, I have specified a dedicated version of JVM to use. If launching by double clicking the
.exe
, the application will use the JVM specified in the
.ini
.

However, if launching in command line with
-console
option, it won't use the JVM specified in the
.ini
. Remove the -console option fixes the issue.

The error message is "
Java was started but returned exit code=1
". And in the pop up window, I am seeing both the
-vm <my JVM path>
and
-vm C:\Windows\system32\java.exe
. Looks like
-console
option adding some extra options
to the launch configuration including the 2nd
-vm
.

Why is that? If I need both
-vm
&
-console
options, how do I do that?

Answer

Turned out that I use my own JRE package, which has the java.dll deleted for shrinking package size. Without java.dll, the -console option won't work. Since there was no error message, so it's hard to find root cause.