Jump to: navigation, search

Difference between revisions of "J9"

(Foundation 1.1)
 
(9 intermediate revisions by 5 users not shown)
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 [http://incubator.apache.org/harmony/ Apache Harmony] project for use in running their class libraries.
+
'''J9''' is the Java VM and classlibrary technology from [http://www.ibm.com IBM].  It is highly versatile and is used as the basis for many of IBM's product offerings from embedded devices to enterprise solutions.  IBM has also made the J9 VM available to the [http://harmony.apache.org/ Apache Harmony] project for use in running their class libraries.
  
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.
+
IBM offers a number of J9 configurations free for evalutation purposes.  For Eclipse developers looking to compile or run bundles that require only the Foundation 1.0 classes, this is ideal.
  
 
===Getting J9===
 
===Getting J9===
Line 12: Line 12:
 
# 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)
 
# 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
 
# 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.  
+
# 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...)
 
# 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.
 
# after the download completes, run the installer and follow the instructions etc etc.
# when the install completes there will be a zip file called something like weme-win-x86-ppro10_6.1.0.20060317-111429.zip 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.  Of the ~46MB you downloaded, you actually only want that 8.5MB zip!
+
# '''when the install completes there will be a zip file called something like weme-win-x86-ppro10_6.1.0.20060317-111429.zip 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.  Of the ~46MB you downloaded, you actually only want that 8.5MB zip!
 
# unzip the J9 configuration zip file wherever you like
 
# unzip the J9 configuration zip file wherever you like
  
 
===Running J9===
 
===Running J9===
 
J9 runs like any other Java system with the exception that the executables are called 'j9' and 'j9w' instead of 'java' and 'javaw'.
 
J9 runs like any other Java system with the exception that the executables are called 'j9' and 'j9w' instead of 'java' and 'javaw'.
 +
 +
'''Ensure that the JAVA_HOME environment variable is not set.  Having it set confuses  other Javas (including J9) into using different directory structures.'''
  
 
===Configuring J9 into your IDE===
 
===Configuring J9 into your IDE===
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.   
+
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.
+
* '''Ensure that the JAVA_HOME environment variable is not set.  Having it set confuses  other Javas (including J9) into using different directory structures.'''
 +
 
 +
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.
  
 
===Foundation 1.1===
 
===Foundation 1.1===
You may have noticed Foundation 1.1 downloads available.  You 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 [http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt-debug-home/plugins/org.eclipse.jdt.launching.j9/index.html JDT Debug page].
+
You may have noticed Foundation 1.1 downloads available.  If you are using Eclipse 3.3.x, 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 [http://www.eclipse.org/eclipse/debug/j9/j9_launching.php JDT Debug page]. If you are using Eclipse 3.4 (M2 or higher), you can use an [http://wiki.eclipse.org/index.php/Execution_Environment_Descriptions execution environment description] file to configure J9.
 +
 
 +
For example, an .ee file with the following contents could be used to configure J9 for Foundation 1.1. This example file defines paths relative to the location where the .ee file is installed - <code>${ee.home}</code> - and assumes the .ee file is installed in the bin directory of the J9 installation.
 +
 
 +
<code><pre>
 +
-Dcom.ibm.oti.vm.exe=${ee.home}\j9.exe
 +
-Djava.home=${ee.home}\..
 +
-Dcom.ibm.oti.vm.bootstrap.library.path=${ee.home}\
 +
-Djava.library.path=${ee.home}\;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\
 +
-Xjcl:jclfoun11_23
 +
 
 +
-Dee.vm.library=j9vm23.dll
 +
-Dee.library.path=.
 +
 
 +
-Dee.executable=j9w.exe
 +
-Dee.executable.console=j9.exe
 +
 
 +
-Dee.bootclasspath=..\lib\jclFoundation11\classes.zip;..\lib\charconv.zip;..\lib\jclFoundation11\locale.zip;..\lib\jclFoundation11\ext\j9jce.jar;..\lib\jclFoundation11\ext\j9jsse.jar
 +
-Dee.src=../lib/jclFoundation11/source/source.zip
 +
-Dee.ext.dirs=..\lib\ext;..\lib\jclFoundation11\opt-ext
 +
 
 +
-Dee.language.level=1.4
 +
-Dee.class.library.level=CDC-1.1/Foundation-1.1
 +
-Dee.id=CDC-1.1/Foundation-1.1[jclfoun11,jit]
 +
-Dee.name="IBM J9 WebSphere Everyplace Micro Environment"
 +
-Dee.description="IBM J9 J2ME Foundation Specification v1.1"
 +
-Dee.copyright="(c) Copyright IBM Corp. 1991, 2006  All Rights Reserved"
 +
</pre></code>
 +
 
 +
To define an installed JRE in the IDE using an .ee file go to the '''Java > Installed JREs''' preference page and press the "Add..." button. On the '''JRE Type''' page (shown below), select the '''Execution Environment Description''' VM type and press the "Next" button.
 +
 
 +
[[Image:Select-vm-type.PNG]]
 +
 
 +
On the '''JRE Definition''' page (shown below) type in the location of the .ee file or use the "File..." button to select the .ee file. This will fill in attributes for the JRE from the .ee file. Press "Finish". You can now use the Foundation 1.1 configuration of J9 for building, running and debugging.
 +
 
 +
[[Image:Vm-attributes.PNG]]
 +
 
 +
[[Category:Equinox]]

Latest revision as of 22:49, 15 October 2007

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 devices to enterprise solutions. IBM has also made the J9 VM available to the Apache Harmony project for use in running their class libraries.

IBM offers a number of J9 configurations free for evalutation purposes. For Eclipse developers looking to compile or run bundles that require only the Foundation 1.0 classes, this is ideal.

Getting J9

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.

  1. go to the WEME trials site
  2. select any of the links in the right hand column of the WEME 6.1 table (the first table on the page)
  3. 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)
  4. verify that you are about to get the right thing and click "Continue"
  5. 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)
  6. be sure to read and then agree to the license
  7. 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.
  8. Download the Binary or Executable file as you choose (acutally I don't know what a .bin file is...)
  9. after the download completes, run the installer and follow the instructions etc etc.
  10. when the install completes there will be a zip file called something like weme-win-x86-ppro10_6.1.0.20060317-111429.zip 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. Of the ~46MB you downloaded, you actually only want that 8.5MB zip!
  11. unzip the J9 configuration zip file wherever you like

Running J9

J9 runs like any other Java system with the exception that the executables are called 'j9' and 'j9w' instead of 'java' and 'javaw'.

Ensure that the JAVA_HOME environment variable is not set. Having it set confuses other Javas (including J9) into using different directory structures.

Configuring J9 into your IDE

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 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.

  • Ensure that the JAVA_HOME environment variable is not set. Having it set confuses other Javas (including J9) into using different directory structures.

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 environment automatically.

Foundation 1.1

You may have noticed Foundation 1.1 downloads available. If you are using Eclipse 3.3.x, 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. If you are using Eclipse 3.4 (M2 or higher), you can use an execution environment description file to configure J9.

For example, an .ee file with the following contents could be used to configure J9 for Foundation 1.1. This example file defines paths relative to the location where the .ee file is installed - ${ee.home} - and assumes the .ee file is installed in the bin directory of the J9 installation.

-Dcom.ibm.oti.vm.exe=${ee.home}\j9.exe
-Djava.home=${ee.home}\..
-Dcom.ibm.oti.vm.bootstrap.library.path=${ee.home}\
-Djava.library.path=${ee.home}\;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\
-Xjcl:jclfoun11_23

-Dee.vm.library=j9vm23.dll
-Dee.library.path=.

-Dee.executable=j9w.exe
-Dee.executable.console=j9.exe

-Dee.bootclasspath=..\lib\jclFoundation11\classes.zip;..\lib\charconv.zip;..\lib\jclFoundation11\locale.zip;..\lib\jclFoundation11\ext\j9jce.jar;..\lib\jclFoundation11\ext\j9jsse.jar
-Dee.src=../lib/jclFoundation11/source/source.zip
-Dee.ext.dirs=..\lib\ext;..\lib\jclFoundation11\opt-ext

-Dee.language.level=1.4
-Dee.class.library.level=CDC-1.1/Foundation-1.1
-Dee.id=CDC-1.1/Foundation-1.1[jclfoun11,jit]
-Dee.name="IBM J9 WebSphere Everyplace Micro Environment"
-Dee.description="IBM J9 J2ME Foundation Specification v1.1"
-Dee.copyright="(c) Copyright IBM Corp. 1991, 2006  All Rights Reserved"

To define an installed JRE in the IDE using an .ee file go to the Java > Installed JREs preference page and press the "Add..." button. On the JRE Type page (shown below), select the Execution Environment Description VM type and press the "Next" button.

Select-vm-type.PNG

On the JRE Definition page (shown below) type in the location of the .ee file or use the "File..." button to select the .ee file. This will fill in attributes for the JRE from the .ee file. Press "Finish". You can now use the Foundation 1.1 configuration of J9 for building, running and debugging.

Vm-attributes.PNG