Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Equinox Launcher Plan

Revision as of 17:17, 10 November 2006 by Unnamed Poltroon (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The following is a proposal for the new Equinox Launcher in support of the 3.3 plan item for improving the launching experience [1]. This work will need to happen in conjunction with any changes that are being made to startup.jar [2][3]. This new launcher will do the following:

  • Use JNI to start the VM [4]
  • Allow for updating the launcher
  • Allow for SWT widgets in the splash screen [5][6]


JNI Launching

Instead of execing java, the equinox launcher will load the jvm shared library and use JNI to create the vm. To do this the launcher will need to do the following:

  • Find the jvm shared library.
  • Setup the LD_LIBRARY_PATH on those platforms that require it.
  • Find the startup.jar. By default it is simply startup.jar in the root of eclipse. The launcher also supports specifying the jar using the -jar argument.
  • Find the Main class. We don't want to parse the manifest to get the Main-Class header. By default we will assume org.eclipse.core.launcher.Main. We should provide an argument -class where this can be specified.
  • Start the VM using JNI, and invoke the Main.main(String[]) method.

Finding the shared Library

We have an existing strategy for finding a java executable. We should look for the jvm library in a location relative to the java executable.

  • We should also allow the user to specify the library directly using the -vm argument.
  • We should also support reading a properties file containing the needed information. The Apache Harmony project [7] has similar requirements.
  • Some VMs will contain more than one library (ie client & server, or j9vm & classic). The launcher will need to understand the JRE's arguments that are used to select a particular vm (-client, -server, -hotspot, -Xj9)
  • On Windows, we may also need to consult the registry to find the vm library. The key [HKCU|HKLM]\Software\JavaSoft\Java Runtime Environment lists installed jvms by version number.

Adding JNI Callback methods

Using JNI to launch the VM allows us to register native methods that can be called from Java. These methods can be use to avoid having Java exec the launcher in order to pass information back through shared memory. They can also be used in support of an SWT splash screen.

Links

  1. Bug 154088 Improve the launching experience.
  2. Bug 159122 Move the startup.jar code
  3. Bug 107738 Investigate if the startup.jar can be delivered as a plugin.
  4. Bug 82518 Use JNI to Launch Eclipse
  5. Bug 111539 Report splash screen progress based on jobs.
  6. Bug 141792 API for custom startup progress reporting.
  7. Apache Harmony

Back to the top