Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 269502 - [fwkAdmin] -vm options is corrupted during autorestart after working with update site
Summary: [fwkAdmin] -vm options is corrupted during autorestart after working with upd...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Matthew Piggott CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 270353 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-03-20 08:01 EDT by Alexey Markevich CLA
Modified: 2009-04-03 10:16 EDT (History)
4 users (show)

See Also:


Attachments
FileUtils patch (1.32 KB, patch)
2009-03-23 11:32 EDT, Matthew Piggott CLA
no flags Details | Diff
Relativization change & FileUtils bugfix (2.32 KB, patch)
2009-03-30 13:48 EDT, Matthew Piggott CLA
john.arthorne: iplog+
Details | Diff
Windows test case fix (1.61 KB, patch)
2009-04-02 16:29 EDT, Matthew Piggott CLA
john.arthorne: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Markevich CLA 2009-03-20 08:01:27 EDT
I haven't java.exe at PATH so in eclipse.ini file I add parameters like this:
-vm
c:/jdk1.5.0_17/bin
Then I (un)install plugins from update site and at Software Updates dialog push Yes button.
But Eclipse doesn't start because parameter is changed to
-vm
file:/c:/jdk1.5.0_17/bin
Comment 1 Pascal Rapicault CLA 2009-03-20 09:55:54 EDT
Which eclipse build are you using?
What were you installing / updating?
Comment 2 Alexey Markevich CLA 2009-03-20 11:35:10 EDT
Sorry, 3.5 M6
I'm working with own simple plugin which have update site.
Comment 3 Pascal Rapicault CLA 2009-03-20 13:07:21 EDT
The target milestone is used to indicate an expected date for fixing the bug. 3.5 M6 is over :)
Comment 4 Matthew Piggott CLA 2009-03-23 11:32:36 EDT
Created attachment 129609 [details]
FileUtils patch

It looks like this was caused by FileUtils.toPath, it attempts to verify that the URI refers to a file.  Unfortunately it was comparing the URI's scheme to file protocol (file:) rather than the file scheme (file) which would always return false.

I wasn't able to replicate this directly, but experimentation with the calls made in EclipseLauncherParse.setVM() seems to indicate that this would only occur on Windows when Eclipse and the VM are on different drives.
Comment 5 Alexey Markevich CLA 2009-03-24 03:12:04 EDT
Yes, VM installed at drive C: but eclipse at D:
Comment 6 Alexey Markevich CLA 2009-03-26 08:01:03 EDT
If I have VM and eclipse installed at same drive (c:\jdk1.5.0_17 and c:\ECLIPSE35M6) there is another result:
-vm
../jdk1.5.0_17/bin
Maybe keeping this argument unchanged is the best way?
Comment 7 Matthew Piggott CLA 2009-03-26 17:02:22 EDT
(In reply to comment #6)
> If I have VM and eclipse installed at same drive (c:\jdk1.5.0_17 and
> c:\ECLIPSE35M6) there is another result:
> -vm
> ../jdk1.5.0_17/bin
> Maybe keeping this argument unchanged is the best way?
> 

Right.  The location was changed to relative path, does it still fail to load at that point?
Comment 8 Alexey Markevich CLA 2009-03-27 03:50:22 EDT
No, in case same drive location it works.
But changing value confused me.
Comment 9 Pascal Rapicault CLA 2009-03-28 13:05:28 EDT
*** Bug 270353 has been marked as a duplicate of this bug. ***
Comment 10 Pascal Rapicault CLA 2009-03-28 13:07:32 EDT
We need to only the relativize when the VM is located in the install folder.
Comment 11 Gerald Rosenberg CLA 2009-03-28 19:21:40 EDT
(In reply to comment #10)
> We need to only the relativize when the VM is located in the install folder.
> 

Sorry, don't understand the logic of this. As pointed out in Bug 270353, relative paths do have a distinct draw-back and, further, conversion to a relative path is a regression relative to prior Eclipse versions.

Eclipse really should not convert an absolute path to relative, even if the VM and Eclipse installation are on the same drive.

Not sure this is relevant, but at least on Windows, using the autorestart after updating Eclipse or using File->Restart will not result in Eclipse failing to start -- as if Eclipse is using an un-modified cached copy of the eclipse.ini.  Rather, it will be first encountered on a cold restart of Eclipse.
Comment 12 Pascal Rapicault CLA 2009-03-28 21:50:58 EDT
the case I'm talking about is:
c:/eclipse
c:/eclipse/vm/jre

In this case you probably prefer having the path being kept relative.
Comment 13 Gerald Rosenberg CLA 2009-03-28 22:37:25 EDT
(In reply to comment #12)
> the case I'm talking about is:
> c:/eclipse
> c:/eclipse/vm/jre
> 
> In this case you probably prefer having the path being kept relative.
> 

Actually, no.  I am rather certain that if I put an absolute path to the VM in the eclipse.ini, then I intend it to be an absolute path -- quite regardless of the relative locations of the eclipse installation and VM -- and that I prefer to keep it just that way.

I must be missing something. Is there an overriding reason for Eclipse to presume and force a relative path over a user defined absolute path?

Thanks...
Comment 14 Pascal Rapicault CLA 2009-03-29 16:34:37 EDT
The problem is that internally fwk  admin only reason in fully qualified paths (and we currently don't remember the original value specified) and the value accepted when setting is also a fully qualified path. However there are still cases where the user intend to have a relative path and this is when everything is co-located (the vm is within the eclipse install therefore moving eclipse around will move the vm as well).
In the past we had a case where we were writing everything in absolute and it broke this case.

Comment 15 Eric Rizzo CLA 2009-03-30 11:41:16 EDT
I'm sorry, but I don't understand the most recent comment above. What is the reason that eclipse.ini is changed in the first place?
I agree 100% with comment 13 that when I put an absolute path in eclipse.ini I expect it to stay that way. In my opinion there should be NO circumstance where it is changed without my explicit approval or action.
Comment 16 Matthew Piggott CLA 2009-03-30 13:48:06 EDT
Created attachment 130280 [details]
Relativization change & FileUtils bugfix

The change should only relativize JRE locations which are under the Eclipse directory.
Comment 17 Pascal Rapicault CLA 2009-04-01 16:59:04 EDT
Fixed in HEAD.
Comment 18 Matthew Piggott CLA 2009-04-02 16:29:30 EDT
Created attachment 130763 [details]
Windows test case fix

Fixes a slight problem with a test case on windows.
Comment 19 John Arthorne CLA 2009-04-03 10:15:35 EDT
Thanks Matt, I have released your additional fix to HEAD.