This is the mail archive of the
eclipse@sources.redhat.com
mailing list for the gcj-compiled eclipse project.
Recognizing gcj as default StandardVM (JRE System Library)
- From: Andrew Haley <aph at redhat dot com>
- To: Mark Wielaard <mark at klomp dot org>
- Cc: eclipse at sources dot redhat dot com
- Date: Fri, 8 Aug 2003 17:07:26 +0100
- Subject: Recognizing gcj as default StandardVM (JRE System Library)
- References: <1059832556.11511.53.camel@elsschot.wildebeest.org>
Mark Wielaard writes:
> Hi,
>
> It took me some time to convince eclipse to recognize gcj/gij/libgcj as
> standard vm. It is probably best to patch
> org.eclipse.jdt.internal.launching.StandardVMType to better detect that
> it is running as native binary. But for the moment I have just created a
> /usr/bin/java executable which contains:
>
> #!/bin/sh
> /usr/bin/gij-ssa -Dsun.boot.class.path=/usr/share/java/libgcj-3.5-tree-ssa.jar $*
That's rather ingenious. :-)
> That way everything works out of the box for me.
> (sun.boot.class.path is clearly not a documented standard system
> property so Eclipse should really not use it.)
Oh, I dunno. I found full docs for sun.boot.class.path on the
javasoft web site.
> If there is a better way to do this, please let me know.
2003-08-08 Andrew Haley <aph@redhat.com>
* launching/org/eclipse/jdt/internal/launching/StandardVMType.java
(fgCandidateJavaLocations): Add gij-ssa and gij.
Index: launching/org/eclipse/jdt/internal/launching/StandardVMType.java
===================================================================
RCS file: /usr/cygnus/eclipse-cvsroot/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/StandardVMType.java,v
retrieving revision 1.7
diff -c -2 -p -r1.7 StandardVMType.java
*** launching/org/eclipse/jdt/internal/launching/StandardVMType.java 16 Jun 2003 18:50:29 -0000 1.7
--- launching/org/eclipse/jdt/internal/launching/StandardVMType.java 8 Aug 2003 15:57:32 -0000
*************** public class StandardVMType extends Abst
*** 61,66 ****
"bin" + fgSeparator + "java.exe", //$NON-NLS-2$ //$NON-NLS-1$
"jre" + fgSeparator + "bin" + fgSeparator + "java", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
! "jre" + fgSeparator + "bin" + fgSeparator + "java.exe"}; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
!
/**
* Starting in the specified VM install location, attempt to find the 'java' executable
--- 61,68 ----
"bin" + fgSeparator + "java.exe", //$NON-NLS-2$ //$NON-NLS-1$
"jre" + fgSeparator + "bin" + fgSeparator + "java", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
! "jre" + fgSeparator + "bin" + fgSeparator + "java.exe", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
! "bin" + fgSeparator + "gij-ssa", //$NON-NLS-2$ //$NON-NLS-1$
! "bin" + fgSeparator + "gij" //$NON-NLS-2$ //$NON-NLS-1$
! };
/**
* Starting in the specified VM install location, attempt to find the 'java' executable
2003-08-08 Andrew Haley <aph@redhat.com>
* Makefile.am (AM_CXXFLAGS): Define BOOT_CLASS_PATH.
* Makefile.in: Rebuild.
* java/lang/natRuntime.cc (insertSystemProperties): Add
"sun.boot.class.path".
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.311
diff -c -2 -p -w -r1.311 Makefile.am
*** Makefile.am 27 Jul 2003 19:04:41 -0000 1.311
--- Makefile.am 8 Aug 2003 15:49:40 -0000
*************** AM_CXXFLAGS = -fno-rtti -fnon-call-excep
*** 102,106 ****
-Wswitch-enum \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
! -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\""
if USING_GCC
AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
--- 102,107 ----
-Wswitch-enum \
@LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
! -DPREFIX="\"$(prefix)\"" -DLIBDIR="\"$(libdir)\"" \
! -DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\""
if USING_GCC
AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
Index: java/lang/natRuntime.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natRuntime.cc,v
retrieving revision 1.38
diff -c -2 -p -w -r1.38 natRuntime.cc
*** java/lang/natRuntime.cc 25 Jul 2003 13:04:15 -0000 1.38
--- java/lang/natRuntime.cc 8 Aug 2003 15:49:40 -0000
*************** java::lang::Runtime::insertSystemPropert
*** 586,589 ****
--- 586,592 ----
sb->toString ());
}
+
+ // The path to libgcj's boot classes
+ SET ("sun.boot.class.path", BOOT_CLASS_PATH);
// The name used to invoke this process (argv[0] in C).
Andrew.