HOWTO: Building Eclipse v3.0.0 on Linux/PPC (with GTK)

I use the Eclipse IDE almost exclusively for Java development. However I’ve had a difficult time getting it working on my PPC Linux based laptop. This is a HOWTO intended to spare others from the agony I’ve recently been through.

Basically, the idea is the use the Linux/GTK/x86 binary distribution, but strip out the x86-compiled GTK bindings and replace them with PPC-compiled GTK bindings. (compiled from the source distribution)

Note: This is the procedure I used. There is bound to be a more efficient one, but as I already have a working build I’m not as interested in trying to find it. If you have an update you’d like to submit to this document, please email me.

Prerequisites

You must have the IBM JDK v1.4.1 installed. Don’t worry that Eclipse.org tells you v1.4.2 is required. It works just fine with IBM’s v1.4.1.

You must have Apache Ant v1.6.1 installed.

You must have the GNU development tools installed.

The Procedure

  1. mkdir eclipse && cd eclipse
  2. Download the Eclipse Linux (x86/GTK 2) v3.0.
  3. unzip eclipse-SDK-3.0-linux-gtk.zip
  4. cd ..
  5. mkdir eclipse_src && cd eclipse_src
  6. Download the Eclipse Source Build v3.0.
  7. unzip eclipse-sourceBuild-srcIncluded-3.0.zip
  8. cd plugins/org.eclipse.swt.gtk
  9. ant -buildfile build.xml ws/gtk/swtsrc.zip
  10. ant -buildfile build.xml ws/gtk/swt-pisrc.zip
  11. cd ws/gtk
  12. unzip swtsrc.zip
  13. unzip swt-pisrc.zip
  14. Edit make_gtk.mak:
    Under # 32 bit path change JAVA_HOME = ... to JAVA_HOME = /opt/ibm-jdk-bin-1.4.1
    (or wherever you JDK in installed)

    ...  ifeq ($(SWT_PTR_CFLAGS),-DSWT_PTR_SIZE_64) # 64 bit path JAVA_HOME               = /bluebird/teamswt/swt-builddir/jdk1.5.0 AWT_LIB_PATH    = $(JAVA_HOME)/jre/lib/amd64 XTEST_LIB_PATH  = /usr/X11R6/lib64 else # 32 bit path JAVA_HOME               = /opt/ibm-jdk-bin-1.4.1 AWT_LIB_PATH    = $(JAVA_HOME)/jre/bin XTEST_LIB_PATH  = /usr/X11R6/lib endif  ...
  15. Run sh build.sh
  16. cp *.so ../../../../../eclipse/plugins/org.eclipse.swt.gtk_3.0.0/os/linux/x86/
  17. cd ../../../../../eclipse
  18. Create the following in startup.sh:
    java -cp startup.jar org.eclipse.core.launcher.Main -os linux -ws gtk
  19. chmod +x startup.sh
  20. ./startup.sh

You’re done! Eclipse should start, ask you were you’d like your workspace to be stored, and drop you into the “welcome” screen. You can now quit, delete any workspace directories it created and move the eclipse directory under /opt (owned by root of course). You can also safely delete the eclipse_src directory.

References

These links were the most useful in figuring this out:

Much of this procedure was built off of the debian list post. Thanks florian!

Leave a Reply


<Kered.org>   © Copyright 2000-2005 by Derek Anderson
Get Firefox