Running ABAP in Eclipse from a USB stick powered by SapMachine
ABAP in Eclipse powered by
- 30.03.2020 – Added a link where to configure the location of the JVM used by ADT in case it does not reside in a local folder jre within the Eclipse installation
There are several reasons why one would like to run the ABAP Development Tools (aka ABAP in Eclipse) from a USB stick or have a self-contained installation in one separate folder on your laptop.
- Your laptop has no JAVA runtime installed or your IT department has only installed a 32-bit Java runtime version
- You don’t have administrative rights on your laptop or are working on different computers
- It’s cool
One problem that occurs very often is that IT departments have installed a 32bit Java Runtime which is not supported by Eclipse. The latest release of Eclipse requires a 64-bit JVM, and does not support a 32-bit JVM as described here Eclipse/Installation.
I have added a screen shot of such an error message at the end of this blog but did not want to use this as the first picture of my blog.
With SapMachine there is now a SAP supported version of OpenJDK available for SAP customers and partners who wish to use OpenJDK to run their applications such as ABAP in Eclipse.
In order to run ABAP in Eclipse you don’t need a complete JDK. The much smaller JRE 11 from SapMachine is sufficient which can be downloaded from GitHub.
Caution: Please note that SapMachine is not yet supported on the latest Mac OS Catalina.
- Get an installation of Eclipse 2019-09 (e.g. Eclipse IDE for Java Developers)
- Unzip the files to a folder on your USB stick (for example D:\2019-09\eclipse)
- Create a subfolder called jre in the folder where your Eclipse files reside
or alternatively copy it to some other folder on your laptop and set the location where the Java Runtime that shall be used by ADT can be found as here Specifying_the_JVM.
- Download the latest Java Runtime 11 files from GitHub
- Unpack the files into the sub-folder jre that you have just created.
- Run Eclipse
- Create a workspace on your USB stick (D:\eclipse-workspace_2019) or elsewhere
- Install the ABAP Development Tools in Eclipse as described here
As already mentioned this setup can also be used to install eclipse as a self-contained setup in a separate folder on your laptop rather than using a USB stick.
I am administrator and I want to build distributable packages
If you want to build an Eclipse IDE package, that is based on an existing Eclipse IDE package and contains ABAP Development Tools features please check out the step-by-step guide in the Installation Guide (page 32 ff) for ABAP Development Tools.
How do I check the version of my Java Runtime?
You can check the version of the Java Runtime by running the command java -version. In case you only have a 32bit version installed you will see something like the following (that means you don’t see any hint that it is a 64bit version).
C:\Windows\System32>java -version java version "1.8.0_221" Java(TM) SE Runtime Environment (build 1.8.0_221-b11) Java HotSpot(TM) Client VM (build 25.221-b11, mixed mode)
To be on the safe side you can run the following command java -d64 -version as described in this disussion at stackoverflow
C:\Windows\System32>java -d64 -version Error: This Java instance does not support a 64-bit JVM. Please install the desired version.
If we do this on our USB stick in subdirectory “jre\bin” we will see that it is a 64bit version.
D:\2019-09\eclipse\jre\bin>java -version openjdk version "11.0.5" 2019-10-16 LTS OpenJDK Runtime Environment (build 11.0.5+10-LTS-sapmachine) OpenJDK 64-Bit Server VM (build 11.0.5+10-LTS-sapmachine, mixed mode)
Error message when using a 32bit Java Runtime
For completeness I am showing here the error message you will get when you only have a 32bit Java Runtime version installed
Java was started but returned exit code=13 C:\Program Files (x86)\Common Files\Oracle\Java\javapath\javaw.exe