Bug 550091 - Eclipse ignores -vm setting in eclipse.ini if restarted.
Summary: Eclipse ignores -vm setting in eclipse.ini if restarted.
Status: CLOSED MOVED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 4.12   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 551378 578682 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-08-15 03:27 EDT by Samir Huremovic CLA
Modified: 2022-11-03 13:31 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samir Huremovic CLA 2019-08-15 03:27:13 EDT
I have the following in my eclipse.ini
-vm
/usr/lib/jvm/jdk-11.0.4/lib/server/libjvm.so

With this setting, the eclipse process shows the command (ps aux) as:
/bin/sh -c /home/user/tools/eclipse/eclipse

If I restart this eclipse instance, this is no longer the case:
/home/user/tools/eclipse/eclipse -os linux -ws gtk -arch x86_64 -showsplash ... (rest truncated).

Other settings in settings.ini are not ignored as far as I can tell.
Comment 1 Andrey Loskutov CLA 2019-08-20 15:12:46 EDT
I believe I see similar, may be related problem: if I start Eclipse with -vm argument in eclipse.ini and install some plugin, on next restart Eclipse *removes* -vm argument from my eclipse.ini!
Comment 2 Samir Huremovic CLA 2019-08-20 17:02:10 EDT
Haha, I am pretty sure I had the same issue, but was thinking that I somehow have overwritten the file :-D
Comment 3 Andrey Loskutov CLA 2019-11-08 09:50:00 EST

*** This bug has been marked as a duplicate of bug 551378 ***
Comment 4 Mickael Istria CLA 2019-11-08 09:53:48 EST
I'm reopening this one. I think bug 551378 depends on proper resolution of this one.
Comment 5 Mickael Istria CLA 2019-11-08 09:55:07 EST
@Samir: can you please share some simple steps to reproduce?
Comment 6 Andrey Loskutov CLA 2019-11-08 09:56:37 EST
(In reply to Mickael Istria from comment #4)
> I'm reopening this one. I think bug 551378 depends on proper resolution of
> this one.

Isn't same problem? Restarting after p2 touchpoint action uses wrong JVM and so re-writes eclipse.ini?
Comment 7 Mickael Istria CLA 2019-11-08 09:59:17 EST
Also, can you please check the `ps aux | grep java | grep equinox.launcher` when this happens? The resulting Java command will give more information about what parameters are forwarded or not.

(In reply to Andrey Loskutov from comment #6)
> Isn't same problem? Restarting after p2 touchpoint action uses wrong JVM and
> so re-writes eclipse.ini?

Not exactly. The eclipse.ini seems properly modified, but the restart action ignores the new `-vm` argument (because it doesn't reparse eclipse.ini but rebuilds a command line from a set of System properties that aren't updated).
Comment 8 Andrey Loskutov CLA 2019-11-08 10:01:44 EST
(In reply to Mickael Istria from comment #5)
> @Samir: can you please share some simple steps to reproduce?

Download any nightly SDK build, extract, change eclipse.ini from this installation to contain this (before vmargs):

###### 
-vm 
/usr/lib/jvm/java-11-openjdk/bin/java
######

So for example:

######
-startup
plugins/org.eclipse.equinox.launcher_1.5.600.v20191014-2022.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190907-0426
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm 
/usr/lib/jvm/java-11-openjdk/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx16G
-Declipse.p2.unsignedPolicy=allow
--add-modules=ALL-SYSTEM
######

Now start this Eclipse for the first time, go to File -> Import -> Install Software Items from file and select 
eclipse.platform.ui/releng/org.eclipse.ui.releng/platformUiTools.p2f file (from platform ui git repo).

Confirm everything and restart.

-vm is removed form the eclipse.ini file.
Comment 9 Johan Compagner CLA 2019-11-08 10:04:26 EST
i really if anything in that feature that you then install is doing a SetJvmAction or another kind of native touchpoint action that is setting the jvm to null and that would cause a remove of the -vm property completely...
Comment 10 Johan Compagner CLA 2019-11-08 10:23:49 EST
testing this with: eclipse-SDK-4.13-win32-x86_64.zip

and then https://git.eclipse.org/c/platform/eclipse.platform.ui.git/plain/releng/org.eclipse.ui.releng/platformUiTools.p2f

under windows where i add a -vm first when i start
and i don't have any problems when installing all packages from that p2f file.
Comment 11 Andrey Loskutov CLA 2019-11-08 10:38:38 EST
(In reply to Johan Compagner from comment #10)
> where i add a -vm first when i start

Not sure what do you mean by that. The -vm should be in the ini file *before* you start for the first time.

> and i don't have any problems when installing all packages from that p2f
> file.

See the problem from comment 10 every day (I switch to last nightly build every day) since years on the Linux box, just had no time to report that.
Comment 12 Johan Compagner CLA 2019-11-08 10:43:20 EST
yes thats what i mean
i added the -vm first (before) i start

its weird then for me on windows with the standard eclipse SDK my -vm stays there.
Comment 13 Andrey Loskutov CLA 2019-11-15 03:54:17 EST
Fix for bug 551378 doesn't have any effect here, problem with comment 8 is still there.
Comment 14 Rolf Theunissen CLA 2019-12-19 07:56:19 EST
Related to or duplicate of Bug 323565
Comment 15 Mickael Istria CLA 2022-04-07 08:18:12 EDT
*** Bug 578682 has been marked as a duplicate of this bug. ***
Comment 16 Mickael Istria CLA 2022-04-07 08:18:45 EDT
*** Bug 551378 has been marked as a duplicate of this bug. ***
Comment 17 Mickael Istria CLA 2022-11-03 13:31:24 EDT
Moved to https://github.com/eclipse-equinox/p2/issues/166