Skip to main content



      Home
Home » Eclipse Projects » Oomph » Install eclipse with a bundled jre (jre copied inside eclipse installation)
Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1819589] Fri, 17 January 2020 11:18 Go to next message
Eclipse UserFriend
Is it possible with oomph to have the JRE copied inside the eclipse installation in the jre subfolder (i.e folder eclipse\jre) so that it will be included in each installation?
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1819609 is a reply to message #1819589] Sat, 18 January 2020 01:48 Go to previous messageGo to next message
Eclipse UserFriend
It's possible in principle, but there are some details that would need attention. E.g., not generating a -vm entry in the eclipse.ini. Also, while a Resource Copy task can be used to unzip a remote resource (zip) into a local folder, on Mac and Linux there is the issue of setting the executable bits for the JRE to be properly functional.

Note that we have approval to redistribute OpenJDK so some work will be done in this area soon:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=506244
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847910 is a reply to message #1819609] Fri, 12 November 2021 05:05 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
I am also trying to do bundled JRE and I would like to ask you how can I get rid off predefined -vm <java_path> in eclipse.ini.

I succesfully copied resources into eclipse install destination. I add -vm budled_java_path into Eclipse.ini.

But I do have predefined init task during setup which adds my localy installed java into Eclipse.ini.

See the attachted picture:
- yellow marked lines are somehome predefined and I do not know how to get rid of them
- red maked is my task which should be the only one there.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847911 is a reply to message #1847910] Fri, 12 November 2021 05:34 Go to previous messageGo to next message
Eclipse UserFriend
Did you create the task exactly like this?
<?xml version="1.0" encoding="UTF-8"?>
<setup:EclipseIniTask
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    option="-vm"
    value="jre/bin"/>
It's important to separate the two parts into the option/value so that this -vm task overrides the other -vm task.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847912 is a reply to message #1847911] Fri, 12 November 2021 05:38 Go to previous messageGo to next message
Eclipse UserFriend
Ed Merks wrote on Fri, 12 November 2021 10:34
Did you create the task exactly like this?
<?xml version="1.0" encoding="UTF-8"?>
<setup:EclipseIniTask
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    option="-vm"
    value="jre/bin"/>
It's important to separate the two parts into the option/value so that this -vm task overrides the other -vm task.



I used the UI editor instead of XML. It looks like this in my .setup file:

<setupTask
          xsi:type="setup:EclipseIniTask"
          option="-vm "
          value="jre/bin"/>


Its hard to now the syntax without documentation :( But I will try it your way :)
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847913 is a reply to message #1847912] Fri, 12 November 2021 06:49 Go to previous messageGo to next message
Eclipse UserFriend
It worked perfectly! Thank you very much.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847914 is a reply to message #1847913] Fri, 12 November 2021 07:04 Go to previous messageGo to next message
Eclipse UserFriend
Note that in your original version you had a space after -vm whereas the correct version does not have that.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847915 is a reply to message #1847914] Fri, 12 November 2021 07:18 Go to previous messageGo to next message
Eclipse UserFriend
Yes, I have noticed, thats what I changed. Thank you again :)
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847918 is a reply to message #1847915] Fri, 12 November 2021 10:07 Go to previous messageGo to next message
Eclipse UserFriend
I do have another question. I am using Resource Copy task to copy unzipped jre folder into installed eclipse instance using as target path: ${installation.location/}${installation.relativeProductFolder}

it works as it should... sort of.

It creates the jre folder in target path, copy some of files into it, but in the comparation of source/target file count, filecounts are not the same, in target folder are 100-ish files missing.

Any ideas, how to solve it? :(
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847922 is a reply to message #1847918] Fri, 12 November 2021 11:03 Go to previous messageGo to next message
Eclipse UserFriend
I don't have a theory for that. You could create a development environment using https://www.eclipse.org/setups/installer/?url=http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/configurations/OomphConfiguration.setup&show=true and then try running the task in debug mode with a breakpoint in org.eclipse.oomph.setup.impl.ResourceCopyTaskImpl.perform(SetupTaskContext) to see what's happening. You could debug the launched installer or for quick testing, you could launch the "IDE" launcher in debug mode, use Navigate -> Open Setup -> Workspace, copy your resource copy task into the Workspace (with a target location that works for testing purposes), and then use Help -> Perform Setup Tasks to run it.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1847948 is a reply to message #1847922] Mon, 15 November 2021 02:28 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your tip, I already use debugging. :) I will try to debug this task and hopefully it will get me on to something.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1848506 is a reply to message #1847948] Mon, 06 December 2021 04:20 Go to previous messageGo to next message
Eclipse UserFriend
I found out the root cause of my trouble. The problem was the task priorities. I setup the (copy destination) java bundle path into Eclipse.ini. But the Eclipse.ini task run earlier than copy task. Once I setup the predecessors for Eclipse.ini task, it started working perfectly.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872198 is a reply to message #1819589] Thu, 24 October 2024 18:41 Go to previous messageGo to next message
Eclipse UserFriend
Hi, I've just stumbled upon this topic as I'm trying to simplify my teams Oomph IDE install, whilst also upgrading us from 4.23 to 4.31.

A pain point is I have to ask everyone to install Java 17 JDK, and then additionally Java 8 JDK, as that is what our code is built against. I'd love it if I can tell them they no longer have to worry about Java installs as Oomph does it!

I've attempted to Resource Copy zipped up versions of the JDKs from a URL, then used the Unzip task (https://github.com/maybeec/oomph-task-unzip) to extract the zip to the workspace, then setting up the JRE info etc etc....
I was very close, but then realised, the unzip task I've been using hasn't been extracting correctly, although everything is named correctly, the bin folder, for instance, is just a load of 'Document' file types of around 118KB. So I don't think that task is suitable.

It seems from this topic its possible though? How should I go about getting Oomph to obtain an archived JDK, extract to a given location, and use it? Is there a clever way I'm missing?

Thanks in advance for any help!

[Updated on: Thu, 24 October 2024 18:42] by Moderator

Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872207 is a reply to message #1872198] Fri, 25 October 2024 03:11 Go to previous messageGo to next message
Eclipse UserFriend
The Resource Copy task can do unzipping. For example, I use this to download an maven installation and then unzip it into a known location:
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0">
  <setup:ResourceCopyTask
      sourceURL="https://archive.apache.org/dist/maven/maven-${maven.version|majorVersion}/${maven.version}/binaries/apache-maven-${maven.version}-bin.zip"
      targetURL="${user.home|uri}/downloads/">
    <description>Copies the appropriate version of the Maven zip distribution for use in the IDE by m2e.</description>
  </setup:ResourceCopyTask>
  <setup:ResourceCopyTask
      sourceURL="archive:${user.home|uri}/downloads/apache-maven-${maven.version}-bin.zip!/"
      targetURL="${user.home|uri}/tools/">
    <description>Unzip the Maven distribution to the tools folder in the user.home.</description>
  </setup:ResourceCopyTask>
</xmi:XMI>
The trick is just to use (jar|zip|archive):<uri-of-jar>!/ as the source URI and to ensure that both URLs are treated as folders, i.e., the URI ends with /. Technically this could be done with one task rather than with two separate ones as I've done above.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872213 is a reply to message #1872207] Fri, 25 October 2024 04:26 Go to previous messageGo to next message
Eclipse UserFriend
Thank you Ed, I didn't know it did this, I'm more than pleased it does!

Knowing it does this now, its a game-changer, so I'm looking at how to bypass the Java VM selection on the first Eclipse Installer dialog, as I will hopefully be providing our own.

Some users might be installing on a clean machine with no Java's installed, so I'm testing this, but I can't seem to shift the 'No match; click to configure...' message, so it won't allow the wizard to progress. (I've tried setting the Required Java Version for the product to be blank, null, and 0...neither worked)

As other users seem to have provided their own JRE, I'm assuming there must be a way? I've looked through the code on github, but I've not spotted anything yet.

[Updated on: Fri, 25 October 2024 04:26] by Moderator

Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872216 is a reply to message #1872213] Fri, 25 October 2024 05:09 Go to previous messageGo to next message
Eclipse UserFriend
For testing a "new user experience" it's quite handy to use these VM args:
-Duser.home=D:\Users\test39
-Doomph.setup.user.home.redirect=true
This will make the installer use that user home and will generate that system property in the installation. Afterward you can delete that entire folder to start from scratch again.

Just this week I addressed this issue:

https://github.com/eclipse-oomph/oomph/issues/112

Though that's for a slightly different case where the location is needed for the JRE task. I expect the installation page will use a JustJ JRE if there is no physically installed JDK on the machine. Isn't that happening?

Unfortunately the resource copy task happens only after you perform them, and that selection box on the first page is very fussy about choosing something that really exists.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872219 is a reply to message #1872216] Fri, 25 October 2024 05:27 Go to previous messageGo to next message
Eclipse UserFriend
No, at the moment I see this:
index.php/fa/45369/0/

...and the Java's look like this:
index.php/fa/45372/0/

...the download button also doesn't do anything on my machine when clicked.

I think I'm happy about the JRE selection in the variables page. I think I've seen that if I make its path value something that's known, it doesn't appear on the variables page.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872222 is a reply to message #1872219] Fri, 25 October 2024 06:56 Go to previous messageGo to next message
Eclipse UserFriend
You know that there are two different installers for macos.? One for x86_64 and one for aarch64. It appears you are using the former and the only JDKs already installed on the system are based aarch64 not x86_64. It's a recent improvement that we properly filter the choices based on the architecture (when support for Windows aarch64 was added just the other week). If you are on an amd/aarch64 machine I expect you would want to use the aarch64 installer for that to create aarch64 installations that use an aarch64 JDK. That should perform better than the emulation mode otherwise used.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872225 is a reply to message #1872222] Fri, 25 October 2024 07:02 Go to previous messageGo to next message
Eclipse UserFriend
Yeah, sadly though we install the core plugin for 'IBM Developer for z/OS' along with its license, which doesn't support aarch64 (not even the latest 17.0.0 release last weekend), it goes BANG, so we just use rosetta2 and x86 everything on Mac Mx.

Maybe its worth a fresh attempt on the latest release, just in case.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872231 is a reply to message #1872225] Fri, 25 October 2024 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Are you using your own index? The "standard" index has this annotation:
<?xml version="1.0" encoding="UTF-8"?>
<base:Annotation
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:base="http://www.eclipse.org/oomph/base/1.0"
    source="http://www.eclipse.org/oomph/setup/JRE">
    <reference
        href="org.eclipse.jres.setup#/"/>
</base:Annotation>
That's used to load this resource:

https://github.com/eclipse-oomph/oomph/blob/master/setups/org.eclipse.jres.setup

And that's used to populate the drop-down combo box with p2 update site links to the JustJ JREs.

index.php/fa/45375/0/

That appears to be missing for you and that would normally help produce a valid selection that would allow the user to continue to the next page.
  • Attachment: jres.png
    (Size: 16.12KB, Downloaded 152 times)
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872240 is a reply to message #1872231] Fri, 25 October 2024 10:56 Go to previous messageGo to next message
Eclipse UserFriend
Ah, yes, we do use our own index, that would explain it.

I've given aarch64 a go, and it does work now with IDz 17, it didn't with 16, so I will start using aarch installer for Mac Mx now.

I think I've now hit a brick wall for the reason you gave earlier in the thread regarding using pre-packaged JREs. Resource Copy does now extract a zipped up JRE where I want, but the executable bits have been lost, so the JRE isn't runnable, unless I can run a script, I don't think its do'able?
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872246 is a reply to message #1872240] Fri, 25 October 2024 12:18 Go to previous messageGo to next message
Eclipse UserFriend
I'm not sure if there are "extended "versions of zip that preserve executable bits. Maybe that's why generally *.tar.gz resources are provided. Maybe that could somehow be supported in a similar way; unfortunately my ability to help will be drastically reduced by travels until mid November...

It's possible to run a script, but only using launch configurations launching an external tool which only would work in the IDE itself. I'm not sure what to suggest.
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872264 is a reply to message #1872246] Sat, 26 October 2024 03:31 Go to previous messageGo to next message
Eclipse UserFriend
FYI, I committed the following change:

https://github.com/eclipse-oomph/oomph/commit/c9e39fb39b97402a9c07cb1277f7a48efb3a3319

I tested that on Linux this transfers the posix permissions in the zip file to the target file.

This will be available in a nightly build when the following produces a successful build:

https://ci.eclipse.org/oomph/job/build/job/master/

That will update these installers with the new support:

https://download.eclipse.org/justj/?file=oomph/products/latest
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872354 is a reply to message #1872264] Mon, 28 October 2024 20:35 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed, this is fantastic, thank you for doing that. I can confirm that this part of puzzle now works and I can extract zips of JREs containing executables on Linux/Mac! I've also put in place a dummy 'org.eclipse.jres.setup' so I can get past the first dialog without setting a proper JRE.

I've now hit a new snag though which I've been going round in circles trying to pinpoint. BOOTSTRAP successfully extracts a J17 JRE into a folder for a 4.31 install, the eclipse ini -vm option points to that folder, all plugins seem to install during BOOTSTRAP, the BOOTSTRAP tasks successfully complete, Eclipse then successfully starts up using the specified JRE, but when the STARTUP tasks kick in, it says I have a long list of requirements that aren't being met and need installing (yet if I look through the setup.log I can see they were).

At the moment, this doesn't seem to happen if I configure some JVMs in the Eclipse Installer, even if I don't use them, nor have I not seen it happen on a Mac. It usually always happens on Linux or Windows if I remove the .eclipse & .p2 directories and do a fresh install.

I'll keep playing with it....
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872369 is a reply to message #1872354] Tue, 29 October 2024 06:58 Go to previous messageGo to next message
Eclipse UserFriend
Got it....although my org.eclipse.jres.setup contained a 'dummy' JRE, it would still attempt to install anything from the P2 repository contained within it (although there was no requirement).....and 'merge disabled' was set to true by default, so the act of having 2 seperate P2 install stages seemed to mess everything up.

Everything working perfectly now, thank you again for all your help Ed!
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872401 is a reply to message #1872369] Wed, 30 October 2024 06:11 Go to previous messageGo to next message
Eclipse UserFriend
Woo hoo!
Re: Install eclipse with a bundled jre (jre copied inside eclipse installation) [message #1872461 is a reply to message #1872401] Thu, 31 October 2024 19:50 Go to previous message
Eclipse UserFriend
Funny how a task I started 4 years ago comes to fruition. Thanks Ed and Mark for following up on this.
Previous Topic: Profile folder name generation / Oomph RSE pre-config
Next Topic:Can I configure the default checkout for github projects to HTTPS (readonly, anonymous)
Goto Forum:
  


Current Time: Sat Jul 19 04:55:03 EDT 2025

Powered by FUDForum. Page generated in 0.09110 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top