Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338703 - Launcher finds Sun VM instead of IBM VM on Windows
Summary: Launcher finds Sun VM instead of IBM VM on Windows
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Launcher (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-02 12:05 EST by Andrew Johnson CLA
Modified: 2019-09-24 13:55 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Johnson CLA 2011-03-02 12:05:29 EST
I have an IBM VM as my system VM (the IBM java.exe is first on the path in C:\windows\system32 )

When I start Eclipse Memory Analyzer, an RCP application, it uses the Sun VM instead. I think this is because org.eclipse.equinox.executable/library/win32/eclipseWin.c doesn't find a JRE/SDK directory for the first java.exe on the path, so goes straight to using registry keys to find the VM. See Bug 321080 comment 7 for a description.

I know I could use -vm to chose a VM, but I think the launcher could do better. The simplest solution would be to use isSunVM() on the executable, and only use the registry keys if it is a Sun/Oracle VM. Starting the java.exe otherwise for IBM VMs would be acceptable for me, as that should find the right environment.

Using the IBM registry keys and linking to java.dll would be even better.

The IBM registry keys appear to be:
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java2 Runtime Environment\CurrentVersion
which has a value of 1.6 on my machine
then
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java2 Runtime Environment\1.4.2 
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java2 Runtime Environment\1.5
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java2 Runtime Environment\1.5.0
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java2 Runtime Environment\1.6
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java2 Runtime Environment\1.6.0

all have 
JavaHome
and 
RuntimeLib
defined.

There is also
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java Development Kit\CurrentVersion

HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java Development Kit\1.5.0
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Java Development Kit\1.6

which have
JavaHome
but not RuntimeLib defined

C:\Documents and Settings\Administrator>java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pwi3260sr8fp1ifix-20100903_02(SR8 FP1+IZ83654))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Windows XP x86-32 jvmwi3260sr8-20100401_55940 (JIT enabled, AOT enabled)
J9VM - 20100401_055940
JIT  - r9_20100401_15339
GC   - 20100308_AA)
JCL  - 20100903_02



C:\Documents and Settings\Administrator>"c:\Program Files\IBM\Java60\jre\bin\java.exe" -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pwi3260sr8fp1ifix-20100903_02(SR8 FP1+IZ83654))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Windows XP x86-32 jvmwi3260sr8-20100401_55940 (JIT enabled, AOT enabled)
J9VM - 20100401_055940
JIT  - r9_20100401_15339
GC   - 20100308_AA)
JCL  - 20100903_02



*** System properties:
awt.toolkit=sun.awt.windows.WToolkit
eclipse.commands=-os
win32
-ws
win32
-arch
x86
-showsplash
-launcher
C:\m5\MemoryAnalyzer-1.0.1.20100809-win32.win32.x86\mat\MemoryAnalyzer.exe
-name
MemoryAnalyzer
--launcher.library
C:\m5\MemoryAnalyzer-1.0.1.20100809-win32.win32.x86\mat\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll
-startup
C:\m5\MemoryAnalyzer-1.0.1.20100809-win32.win32.x86\mat\plugins\org.eclipse.equinox.launcher_1.0.200.v20090520.jar
-vm
C:\Program Files\Java\jre6\bin\client\jvm.dll
eclipse.home.location=file:/C:/m5/MemoryAnalyzer-1.0.1.20100809-win32.win32.x86/mat/
eclipse.launcher=C:\m5\MemoryAnalyzer-1.0.1.20100809-win32.win32.x86\mat\MemoryAnalyzer.exe
eclipse.product=org.eclipse.mat.ui.rcp.MemoryAnalyzer
eclipse.startTime=1298901024062
eclipse.vm=C:\Program Files\Java\jre6\bin\client\jvm.dll
eclipse.vmargs=-Xmx1024m
-Djava.class.path=C:\m5\MemoryAnalyzer-1.0.1.20100809-win32.win32.x86\mat\plugins\org.eclipse.equinox.launcher_1.0.200.v20090520.jar
file.encoding=Cp1252
file.encoding.pkg=sun.io
file.separator=\
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.awt.printerjob=sun.awt.windows.WPrinterJob
java.class.path=C:\m5\MemoryAnalyzer-1.0.1.20100809-win32.win32.x86\mat\plugins\org.eclipse.equinox.launcher_1.0.200.v20090520.jar
java.class.version=50.0
java.endorsed.dirs=C:\Program Files\Java\jre6\lib\endorsed
java.ext.dirs=C:\Program Files\Java\jre6\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
java.home=C:\Program Files\Java\jre6
java.io.tmpdir=C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\
java.library.path=C:\m5\MemoryAnalyzer-1.0.1.20100809-win32.win32.x86\mat;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Program Files\ThinkPad\Utilities;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\IBM\Infoprint Select;C:\Notes;C:\Program Files\XLView;C:\lotus\compnent;C:\Utilities;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\Trace Facility\;C:\Program Files\ThinkPad\ConnectUtilities;C:\WINDOWS\Downloaded Program Files;C:\Program Files\ObjREXX;C:\Program Files\ObjREXX\OODIALOG;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Lenovo;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\IBM\CMVCDC50
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.6.0_18-b07
java.specification.name=Java Platform API Specification
java.specification.vendor=Sun Microsystems Inc.
java.specification.version=1.6
java.vendor=Sun Microsystems Inc.
java.vendor.url=http://java.sun.com/
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
java.version=1.6.0_18
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) Client VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Sun Microsystems Inc.
java.vm.specification.version=1.0
java.vm.vendor=Sun Microsystems Inc.
java.vm.version=16.0-b13
line.separator=
Comment 1 Eclipse Genie CLA 2019-01-31 01:39:57 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Lars Vogel CLA 2019-09-24 13:55:03 EDT
This bug was marked as stalebug a while ago. Marking as worksforme.

If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag.