[fedora-java] java-gcjHEAD-compat (or "How to use your gcc build to run Eclipse")

Andrew Overholt overholt at redhat.com
Wed May 11 20:56:34 UTC 2005


Hi,

Tom Fitzsimmons and I (okay, it was mostly Tom ;) worked out how to have a
set of alternatives for java, javac, etc. that can use a non-system gcc
installation.  This will allow you to easily run our Eclipse packages
(among others) using your gcc builds.

(I'm assuming here that you have a ~/.rpmmacros similar to [2])

1. check java-1.4.2-gcj-compat out of Fedora CVS [1].
2. cd into the java-1.4.2-gcj-compat/devel directory
3. make sources; cp *.tar.gz ~/rpmbuild/SOURCES
4. ensure that your gcc build is ahead of the system compiler in your path
5. rpmbuild \
     --define "custom 1" \
     --define "gcj_prefix <location of your build directory>" \
     --define "origin gcj<YOURSUFFIX>" \
     -ba java-1.4.2-gcj-compat.spec
6. install the resulting RPM (should be in ~/rpmbuild/RPMS/<ARCH>/)
7. set your java and javac alternatives to be those of your gcc build:
  sudo /usr/sbin/update-alternatives --set javac \
    /usr/lib/jvm/java-1.4.2-gcj<YOURSUFFIX>/bin/javac
  sudo /usr/sbin/update-alternatives --set java \
    /usr/lib/jvm/jre-1.4.2-gcj<YOURSUFFIX>/bin/java
8. verify that /usr/bin/java --version gives the same output as your gij

Now running Eclipse (and other apps that use /usr/bin/java) should use your
gcc build.

Andrew

[1]
http://cvs.fedora.redhat.com/core.shtml
http://cvs.fedora.redhat.com/viewcvs/rpms/java-1.4.2-gcj-compat/

[2]
$ cat ~/.rpmmacros
%_topdir /home/overholt/rpmbuild
$ ls /home/overholt/rpmbuild
BUILD  RPMS SOURCES  SPECS  SRPMS




More information about the fedora-devel-java-list mailing list