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 "Execution Environments" and "STP/Archive/Old STP Wiki"

(Difference between pages)
 
(STP - SOA Tools Platform Project)
 
Line 1: Line 1:
==What are Execution Environments?==
+
= STP - SOA Tools Platform Project=
  
Execution environments (EEs) are symbolic representations of JREs. For example, rather than talking about a specific JRE, with a specific name at a specific location on your disk, you can talk about the J2SE-1.4 execution environment.  The system can then be configured to use a specific JRE to implement that execution environment.
+
Welcome to the STP Wiki! This collaborative workspace is here for us to trash out ideas
 +
and concepts before putting the crystallized results on the STP website. Think of this
 +
as the conversation place, and the website as the group memory :-)
  
Execution environments are relevant both to development (compile) time and runtime. 
+
* [[STP Build Process and Procedures]]
  
==So what does this mean to me and my bundles?==
+
* [[STP Website Development]]
  
Good bundles have minimal dependencies.  This allows them to be used in a wider range of situations and results in a smaller overall footprint for applications built of these bundles.  The execution environment needed by your bundle is key in both situations.
 
  
Consider the different outcomes for some bundle A that requires just Foundation 1.0 and a bundle B that requires J2SE-1.5.  First, A can be used in embedded devices where Foundation 1.0 is quite popular.  Second, an application written entirely of bundles such as A can ship on a Foundation 1.0 JRE.  This results in a 40-50MB disk/transfer footprint savings over J2SE-1.5 JREs!
+
[http://eclipse.org/stp STP Home Page]
 
+
==Wow! Is this hard to setup?==
+
Not really.  [http://osgi.org OSGi] allows bundles to be marked with the minimum execution environment they require (see the information below).    Setting this value has two effects.
+
# The compiler attempts to compile your bundle against the JRE associated with the EE you choose.  For example, 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.
+
# The Equinox runtime will refuse to resolve/run your bundle if the current running JRE does not meet the minimum standard you specified.  For example, if you attempt to install bundle B from above (requires J2SE-1.5) on a system running Foundation 1.0, B will not resolve or run.
+
 
+
==Which Execution Environment should I use?==
+
 
+
As discussed above, you should seek to use the smallest EE possible.  Of course, if you actually need the functionality of J2SE-1.5, you should of course specify that EE.  Remember however that people running on J2SE-1.4, Foundation 1.*, etc. will then not be able to use your bundle.
+
 
+
Projects should not leave these choices to chance.  For example, the [http://eclipse.org/eclipse Eclipse Project] has explicitly identified EEs for all of their bundles.  These choices are documented 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 based on the needs of the bundle and the expected use scenarios for the bundle.
+
 
+
==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.
+
 
+
 
+
==Managing Execution Environments==
+
 
+
 
+
 
+
==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.
+
 
+
[[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 10:08, 28 April 2006

STP - SOA Tools Platform Project

Welcome to the STP Wiki! This collaborative workspace is here for us to trash out ideas and concepts before putting the crystallized results on the STP website. Think of this as the conversation place, and the website as the group memory :-)

* STP Build Process and Procedures
* STP Website Development


STP Home Page

Back to the top