Eclipse

Eclipse is a free open source project that's used to run many of the major tools in this cookbook: https://www.eclipse.org/downloads/

Launching Notes

  1. To print console logging, edit the ini file and add the following to lines above any -vm and -vmargs lines. For example:
    -startup
    plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1200.v20200508-1552
    -debug
    -consoleLog
    -vmargs
    -Xmx8G
  2. To print console logging from a terminal without launching a separate terminal, launch the program using eclipsec rather than eclipse or the prudct's executable. For example:
    ./eclipsec -debug -consoleLog
  3. To specify a particular ini file rather than the one in the product's directory, use a terminal to launch with the --launcher.ini argument. For example:
    ./eclipsec --launcher.ini /tmp/eclipse.ini
  4. To modify the JVM arguments from the command line instead of the ini file, use . For example:
    .\eclipsec.exe -debug -consoleLog -vmargs "-Djava.io.tmpdir=%TEMP%"
  5. To use JVM arguments from both the command line and the ini file, add --launcher.appendVmargs in the ini file. For example:
    -startup
    plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1200.v20200508-1552
    --launcher.appendVmargs
    -debug
    -consoleLog
    -vmargs
    -Xmx8G
  6. To change the workspace directory, use the -data argument. For example:
    .\eclipsec.exe --launcher.ini C:\eclipse.ini -data "%APPDATA%\Memory Analyzer" -vmargs "-Djava.io.tmpdir=%TEMP%"
  7. To use system properties such as the user home directory:
    -data
    @user.home/myapp-workspace

Example Windows Launch Script

Also add --launcher.appendVmargs to the ini file after the launcher.library+plugins/ lines.

:: Launcher script
:: Comments start with ::

@echo off

set TITLE=Memory Analyzer Tool Launcher
title %TITLE%
echo %TITLE%

set PATH=C:\IEMA\jre\bin;%PATH%

echo Launching the tool. This may take a few minutes depending on available resources.
C:\IEMA\eclipsec.exe --launcher.ini "C:\IEMA\MemoryAnalyzer.ini" -data "%APPDATA%\MAT" -consoleLog -vmargs "-Djava.io.tmpdir=%TEMP%" "-Xshareclasses:name=mat,cacheDir=%APPDATA%\sharedclasses\mat"

echo(
echo Tool completed. Press any key to end this prompt.
echo(

pause

Setting the Java Virtual Machine that Eclipse Uses

Some tool usages require IBM Java to properly run the analysis (e.g. IBM MAT, IBM Java Health Center, etc.). You may specify the JVM that Eclipse uses in the eclipse.ini file. Above the -vmargs line, add the following two lines, replacing the path to IBM Java that you installed:

-vm
/opt/IBM/Java/ibm-java-x86_64-80/bin/

For Windows, IBM Java provides a pre-packaged Eclipse Neon with IBM Java already configured

  1. Open a browser to https://developer.ibm.com/javasdk/downloads/#tab_eclipse

  2. If you are running Windows 32-bit, click on the "Windows on Intel" link:

    1. https://www.ibm.com/services/forms/preLogin.do?source=idpe&S_TACT=105AGX05&S_CMP=JDK&lang=en_US&S_PKG=win32-6.3.20
  3. If you are running Windows 64-bit, click on the "Windows on AMD64/EMT64T" link:

    1. https://www.ibm.com/services/forms/preLogin.do?source=idpe&S_TACT=105AGX05&S_CMP=JDK&lang=en_US&S_PKG=win64-6.3.20
  4. The download will require you to either register for a free IBM ID or use the "Proceed without an IBM id" button and enter your information.

  5. When you get to the download page, the default option is to use the "Download Director" to download the file which is a Java applet that downloads more quickly by using multiple sockets; however, you may choose the simpler option of a direct link by click on the "Download using http" tab.

  6. Extract the .zip file into a directory of your choice.

  7. Go to the "eclipseDevelopmentPackage\eclipse" subdirectory and launch eclipse.exe.

IBM Java on Linux

  1. Open a browser to https://developer.ibm.com/javasdk/downloads/#tab_sdk8

  2. If you are running Linux 32-bit, under the "Linux on Intel" heading, click on the first "Simple unzip with license" link.

  3. If you are running Linux 64-bit, under the "Linux on AMD64/EMT64T" heading, click on the first "Simple unzip with license" link.

  4. Download the package to any directory, most commonly /opt/IBM/Java

  5. From the terminal, add execute permissions and then run ibm-java-sdk-8.0-3.21-x86_64-archive.bin:

     chmod +x ./ibm-java-sdk-8.0-3.21-x86_64-archive.bin  
     ./ibm-java-sdk-8.0-3.21-x86_64-archive.bin

Eclipse Maximum Heap Size

The maximum heap size for Eclipse may be set in the "-vmargs" section of the eclipse.ini file.

Offline Update Site Installation

  1. Using any Eclipse installation, run metadata.repository.mirrorApplication and artifact.repository.mirrorApplication for each update site. For example:

    Windows:

    > mkdir C:\eclipseupdatesites\dtfj\
    > .\eclipse.exe -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/runtimes/tools/dtfj/ -destination "file:/C:/eclipseupdatesites/dtfj/" -ignoreErrors
    > .\eclipse.exe -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/runtimes/tools/dtfj/ -destination "file:/C:/eclipseupdatesites/dtfj/" -ignoreErrors

    Linux:

    $ mkdir -p /tmp/eclipseupdatesites/dtfj/
    $ ./eclipse -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/runtimes/tools/dtfj/ -destination "file:/tmp/eclipseupdatesites/dtfj/" -ignoreErrors
    $ ./eclipse -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/runtimes/tools/dtfj/ -destination "file:/tmp/eclipseupdatesites/dtfj/" -ignoreErrors
  2. Transfer the downloaded upatesites above to the target machine.

  3. For each updatesite folder:

    1. In Eclipse, click Help } Install New Software...
    2. Click the "Add..." button.
    3. Enter "Local $NAME" (for example, Local DTJF) for the name, click "Local..." and select the update site folder.
    4. After you click OK, Eclipse will automatically select the new update site and load available plugins from which you can select the plugins.