Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 168645

Summary: Cannot start eclipse.exe: VM not found
Product: [Eclipse Project] Equinox Reporter: Dani Megert <daniel_megert>
Component: FrameworkAssignee: Andrew Niefer <aniefer>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: benno.baumgartner, bpasero, john.arthorne
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 168726    
Attachments:
Description Flags
The error dialog none

Description Dani Megert CLA 2006-12-20 03:15:07 EST
I20061219-1300 (works in 3.3 M4)

Looks like the new story no longer finds java.exe

My shortcut to eclipse.exe specifies:

C:\eclipse\drops\I20061219-1300\eclipse.exe -data workspace -vm C:\JavaSDKs\jdk1.4.2_12\bin\java.exe

This shortcut used to work for years but now it is broken.
Comment 1 Dani Megert CLA 2006-12-20 03:18:29 EST
Created attachment 55943 [details]
The error dialog
Comment 2 Martin Aeschlimann CLA 2006-12-20 10:53:45 EST
The following command line seems to work for me on Windows XP:
eclipse -Xms50M -Xmx512M -XX:MaxPermSize=128m -vm C:\devel\jdk1.5.0_10-b03\bin\java -showlocation -data C:\workspaces\eclipse-sh3

but not on Windows Vista where I get a message '.. no Java VM found ... on C:\devel\jdk1.5.0_10-b03\bin\java'

On Vista even double-clicking eclipse.exe doesn't work anymore (without specifying a VM).
Comment 3 Andrew Niefer CLA 2006-12-20 10:59:57 EST
Daniel, can you tell me more about your vm.

The launcher is looking (on windows) for the jvm.dll library.  To find it we look in some known locations relative to the java.exe.  These locations currently are:
j9vm\jvm.dll
client\jvm.dll
server\jvm.dll
classic\jvm.dll

I think the problem here is that we are expecting the java.exe on windows to be in the jre/bin directory in order to find the jre/bin/*/jvm.dll.

If you change your link to point to the jvm.dll like
-vm C:\JavaSDKs\jdk1.4.2_12\jre\bin\client\jvm.dll
does it work?
Comment 4 Dani Megert CLA 2006-12-20 11:03:31 EST
I use C:\JavaSDKs\jdk1.4.2_12

I found out that using
-vm C:\JavaSDKs\jdk1.4.2_12\jre\bin\java.exe

almost works i.e. I can start but Ctrl+Break to get stack traces doesn't work.
Comment 5 Andrew Niefer CLA 2006-12-20 11:38:06 EST
I will update the launcher to account for when the exe is in java\bin instead of java\jre\bin.

Can you please open a separate bug for the ctrl+break and what your expected behaviour is there?  (Are you hitting ctrl+break on the splash? in a console? Are you expecting java stack traces?)
Comment 6 Dani Megert CLA 2006-12-20 11:42:37 EST
When using a Windows Shortcut a dialog opens. This used to work since 1.0. I can create another bug but for me this essential to switch to the new story/build.
Comment 7 Andrew Niefer CLA 2006-12-20 16:00:09 EST
Fixed finding the VM in HEAD.

Daniel, as a work around for any problems you have, it is possible to use an old launcher: copy the org.eclipse.equinox.launcher jar into the root and name it startup.jar.  Then an old launcher will work and the Main class will still load the library from the launcher fragment to do the splash screen.  Java will be started in a separate process, similar to starting with java -jar directly.
Comment 8 Dani Megert CLA 2006-12-21 03:46:32 EST
Thanks Andrew. I fixed the problem and my scripts by simply replacing
startup.jar 
with
plugins\org.eclipse.equinox.launcher_*.jar

This way I don't have to go and change all my script and I know what's going on.
Comment 9 Frederic Fusier CLA 2007-01-10 07:43:38 EST
I see same problem on my Linux box this morning with I20070109-1805 build. Do you want me to reopen this bug and set OS to 'All' or open a new one on 'Linux' OS?
Comment 10 Andrew Niefer CLA 2007-01-10 11:31:48 EST
Can you open a new bug Frédéric, this is very much platform and vm specific.

Is this a Sun VM?  We are looking for libjvm.so.  For Sun on linux, we look in jre/lib/<ARCH>/<client | server>.  We could be getting the ARCH wrong, for x86 we would be using i386. 

Otherwise, is the java executable that we would be starting from (on the path, or from -vm) not actually inside a jdk/jre (after resolving symlinks)?  If it was for  example a script, then the only thing we could do is exec the script (bug 168775)

Comment 11 Dani Megert CLA 2007-01-10 11:50:41 EST
Frédéric, please add me as cc if you create a new bug.