Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between pages "J9" and "Execution Environments"

(Difference between pages)
(Configuring J9 into your IDE)
 
 
Line 1: Line 1:
J9 is the Java VM and classlibrary technology from IBM.  It is highly versatile and is used as the basis for many of IBM's product offerings from embedded to enterprise.  IBM has also made the J9 VM available to the Apache Harmony project for use in running their class libraries.
+
==What are Execution Environments?==
  
IBM offers a number of J9 configurations free for evalutation use.  For Eclipse developers looking to compile or run bundles that require only the Foundation 1.0 classes, this is ideal.
+
Execution environments tell the compiler and runtime the minimum level of class libraries required by your plug-in.  
  
===Getting J9===
+
==Why should I set them for my plug-in?==
The trial J9 configurations are shipped as part of the WebSphere Everyplace Micro Environment (WEME) 6.1 product.  Follow the steps below to get WEME 6.1.
+
  
# go to the [http://www-128.ibm.com/developerworks/websphere/zones/wireless/weme_eval_runtimes.html WEME trials site]
+
Our goal should always be to minimize our dependancies to make our plug-ins useful in more scenerios. If you set your EE to be J2SE-1.3, then the compiler will help you stick to that and not let you use APIs which exist in other class library versions. If you choose to increase your EE level, then you are forced to explicitly do so, rather than finding out later that you did it accidentally by referencing new APIs.
# select any of the links in the right hand column of the WEME 6.1 table (the first table on the page)
+
# on the Trials and betas page choose the trial that applies to you.  Here you are choosing between Linux and Windows (ensure you select version 6.1)
+
# verify that you are about to get the right thing and click "Continue"
+
# at this point you will be ask to login/register. This process is relatively harmless and in the end worthwhile (you are after all getting this JRE for free)
+
# be sure to read and then agree to the license
+
# finally you get to te download page. Here there are several choices so read the headings carefully.  You want "CDC 1.0/Foundation 1.0/Personal Profile1.0 for Windows XP/X86" (or the corresponding one for Linux).  This was the second section at the time of writing.
+
# Download the Binary or Executable file as you choose (acutally I don't know what a .bin file is...)
+
# after the download completes, run the installer and follow the instructions etc etc.
+
# when the download completes there will be a zip file in the install location.  That is the J9 configuration you want.  Ignore all the other _jvm stuff.  That, ironically, is the JRE used to run the installer that "installed" the .zip file.
+
# unzip the J9 configuration zip file wherever you like
+
  
===Running J9===
+
==Which Execution Environment should I use?==
J9 runs like any other Java system with the exception that the executable is called 'j9' instead of 'java'.
+
  
===Configuring J9 into your IDE===
+
Check out the table of execution environments in the [http://www.eclipse.org/eclipse/development/eclipse_project_plan_3_2.html#Appendix1 Eclipse 3.2 Plan]. The execution environment listed in the table is what your plug-in is committed to. If there is an error with the table, please send a note to the  [mailto:eclipse-dev@eclipse.org eclipse-dev] mailing list and someone will update the table.
Now that you have J9 on your system, you need to tell the Eclipse IDE about it.  That is you need to ''install the JRE''.  Follow the [http://help.eclipse.org/help31/topic/org.eclipse.jdt.doc.user/tasks/tasks-121.htm instructions in the Eclipse help]. Choose the "Standard VM" type and use the location into which you unzip'd J9 as the JRE home directory.
+
  
If you are doing plug-in development, there is no need to set this new JRE definition as the default, PDE will match up your [[Execution Environments | execution environment]] automatically.
+
==Setting the Execution Environment==
 +
# Use build N20060420-0010 or later.
 +
# Right click on your plug-in's <tt>MANIFEST.MF</tt> and select '''Open With...''' -> '''Plug-in Manifest Editor'''.
 +
# Select the '''Overview''' tab.
 +
# Note the section in the lower left corner entitled '''Execution Environments'''.
 +
# Add your appropriate environment(s).
 +
# Save the file.
 +
# Select the link "update the classpath and compiler compliance settings".
 +
# Ensure you have no compile errors in your workspace.
 +
# Release your changes to the repository.
  
===Foundation 1.1===
+
 
You may have noticed Foundation 1.1 downloads availableYou are free to use Foundation 1.1 but as of this writing, the J9 Foundation 1.1 configuration is not readily recognized by the Eclipse IDE. Using this configuration requires that you get and install the J9 Launching plugin from the JDT Debug page.
+
==Special cases==
 +
 
 +
===Foundation Class Libraries===
 +
Plug-ins that are Foundation 1.0 should in fact list Foundation 1.0 AND J2SE-1.3 in their execution environmentsThis is because Foundation 1.0 is not a proper subset of 1.3.  Listing them both will in essence say that the intersection of the  
 +
two is valid for use in that plug-in. The situation is the same for Foundation 1.1 and J2SE-1.4.
 +
 
 +
[[J9 | Getting J9]] is the easiest way to get a Foundation JRE to run or compile against.
 +
 
 +
===Compiling Against More Than Is Required===
 +
In some cases, a plug-in may require a higher version to compile against, but is able to run perfectly fine against a lower version. For instance, the <tt>org.eclipse.osgi</tt> bundle will use <tt>java.nio.*</tt> classes if available. So it must be compiled against J2SE-1.4 but can run on OSGI/Minimum-1.0.
 +
 
 +
In these cases the EE required to compile against must appear '''first''' in the list. So for <tt>org.eclipse.osgi</tt>, the list (in order) is ''J2SE-1.4'' then ''OSGI/Minimum-1.0''.
 +
 
 +
===XML===
 +
Some bundles may think that they require an EE of J2SE-1.4 but really the only special thing that they require from the 1.4 class libraries are the JAXP XML APIs. So in these cases they can be listed as having an EE of J2SE-1.3 because they still will run ok if another bundle is providing the XML APIs.

Revision as of 17:44, 20 April 2006

What are Execution Environments?

Execution environments tell the compiler and runtime the minimum level of class libraries required by your plug-in.

Why should I set them for my plug-in?

Our goal should always be to minimize our dependancies to make our plug-ins useful in more scenerios. If you set your EE to be J2SE-1.3, then the compiler will help you stick to that and not let you use APIs which exist in other class library versions. If you choose to increase your EE level, then you are forced to explicitly do so, rather than finding out later that you did it accidentally by referencing new APIs.

Which Execution Environment should I use?

Check out the table of execution environments in the Eclipse 3.2 Plan. The execution environment listed in the table is what your plug-in is committed to. If there is an error with the table, please send a note to the eclipse-dev mailing list and someone will update the table.

Setting the Execution Environment

  1. Use build N20060420-0010 or later.
  2. Right click on your plug-in's MANIFEST.MF and select Open With... -> Plug-in Manifest Editor.
  3. Select the Overview tab.
  4. Note the section in the lower left corner entitled Execution Environments.
  5. Add your appropriate environment(s).
  6. Save the file.
  7. Select the link "update the classpath and compiler compliance settings".
  8. Ensure you have no compile errors in your workspace.
  9. Release your changes to the repository.


Special cases

Foundation Class Libraries

Plug-ins that are Foundation 1.0 should in fact list Foundation 1.0 AND J2SE-1.3 in their execution environments. This is because Foundation 1.0 is not a proper subset of 1.3. Listing them both will in essence say that the intersection of the two is valid for use in that plug-in. The situation is the same for Foundation 1.1 and J2SE-1.4.

Getting J9 is the easiest way to get a Foundation JRE to run or compile against.

Compiling Against More Than Is Required

In some cases, a plug-in may require a higher version to compile against, but is able to run perfectly fine against a lower version. For instance, the org.eclipse.osgi bundle will use java.nio.* classes if available. So it must be compiled against J2SE-1.4 but can run on OSGI/Minimum-1.0.

In these cases the EE required to compile against must appear first in the list. So for org.eclipse.osgi, the list (in order) is J2SE-1.4 then OSGI/Minimum-1.0.

XML

Some bundles may think that they require an EE of J2SE-1.4 but really the only special thing that they require from the 1.4 class libraries are the JAXP XML APIs. So in these cases they can be listed as having an EE of J2SE-1.3 because they still will run ok if another bundle is providing the XML APIs.

Back to the top