This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re: FAQ -- building snapshots?
- To: java-patches at sourceware dot cygnus dot com
- Subject: Re: FAQ -- building snapshots?
- From: Joerg Brunsmann <joerg dot brunsmann at FernUni-Hagen dot de>
- Date: Mon, 03 Jan 2000 14:51:32 +0100
- Organization: Fernuniversitaet Hagen - Software Engineering (Praktische Informatik III)
This patch removes some inconsistencies in faq.html and
it adds a new FAQ entry. Please also find attached the
referenced file "build-snapshot.html". BTW: the file
FAQ.html and the directory "new" in "htdocs/" can be
deleted, I think.
*** faq.html.orig Mon Jan 3 12:06:21 2000
--- faq.html Mon Jan 3 14:27:36 2000
***************
*** 61,100 ****
the support? </a></li>
<li><a href="#2_2">Does GCJ support using straight C native methods
ala JNI? CNI looks kind of hard to use.</a></li>
! <li><a href="#3_3">Why does GCJ use CNI? </a></li>
! <li><a href="#2_3">What is the state of AWT support?</a></li>
! <li><a href="#2_4">How about support for Swing ?</a></li>
! <li><a href="#2_5">What support is there for RMI ?</a></li>
! <li><a href="#2_6">Can I use any code from other OpenSource projects
to supplement libgcj's current features ?</a></li>
! <li><a href="#2_7">What features of the Java language are/arn't supported</a></li>
</ol>
! <li><a href="#2_0">Build Issues</a>
<ol>
<li><a href="#3_2">Linker bug on Solaris</a>
</ol>
<li><a href="#4_0">Gcj Compile/Link Questions</a>
<ol>
<li><a href="#4_1">Why do I get <tt>undefined reference to `main'</tt>
errors?</a>
! <li><a href="#4_2">4.2 Can GCJ only handle source code? </a>
<li><a href="#4_3">"gcj -C" Doesnt seem to work like javac/jikes.
Whats going on? </a>
<li><a href="#4_4">Where does GCJ look for files? </a>
! <li><a href="#4_4">How does gcj resolve wether to compile .class or
.java files? </a>
- <li><a href="#4_5">How do I increase the runtime's initial and maximum
- heap sizes? </a>
</ol>
<li><a href="#5_0">Runtime Questions</a>
<ol>
<li><a href="#5_1">My program is dumping core! What's going on?</a>
<li><a href="#5_2">When I run the debugger I get a SEGV in the GC!
What's going on?</a>
! <li><a href="#5_3">Can I profile Garbage Collection? </a>
! <li><a href="#5_4">How do I increase the runtime's initial and maximum
heap sizes?</a>
! <li><a href="#5_5">How can I profile my application?</a>
</ol>
<li><a href="#6_0">Programing Issues</a>
<ol>
--- 61,103 ----
the support? </a></li>
<li><a href="#2_2">Does GCJ support using straight C native methods
ala JNI? CNI looks kind of hard to use.</a></li>
! <li><a href="#2_3">Why does GCJ use CNI? </a></li>
! <li><a href="#2_4">What is the state of AWT support?</a></li>
! <li><a href="#2_5">How about support for Swing ?</a></li>
! <li><a href="#2_6">What support is there for RMI ?</a></li>
! <li><a href="#2_7">Can I use any code from other OpenSource projects
to supplement libgcj's current features ?</a></li>
! <li><a href="#2_8">What features of the Java language are/arn't supported</a></li>
</ol>
! <li><a href="#3_0">Build Issues</a>
<ol>
+ <li><a href="#3_1">I need something more recent than the last release; how
+ should I build it?</a>
<li><a href="#3_2">Linker bug on Solaris</a>
</ol>
<li><a href="#4_0">Gcj Compile/Link Questions</a>
<ol>
<li><a href="#4_1">Why do I get <tt>undefined reference to `main'</tt>
errors?</a>
! <li><a href="#4_2">Can GCJ only handle source code? </a>
<li><a href="#4_3">"gcj -C" Doesnt seem to work like javac/jikes.
Whats going on? </a>
<li><a href="#4_4">Where does GCJ look for files? </a>
! <li><a href="#4_5">How does gcj resolve wether to compile .class or
.java files? </a>
</ol>
<li><a href="#5_0">Runtime Questions</a>
<ol>
<li><a href="#5_1">My program is dumping core! What's going on?</a>
<li><a href="#5_2">When I run the debugger I get a SEGV in the GC!
What's going on?</a>
! <li><a href="#5_3">I have just compiled and benchmarked my Java application
! and it seems to be running slower than than XXX JIT JVM. Is there
! anything I can do to make it go faster?</a><
! <li><a href="#5_4">Can I profile Garbage Collection? </a>
! <li><a href="#5_5">How do I increase the runtime's initial and maximum
heap sizes?</a>
! <li><a href="#5_6">How can I profile my application?</a>
</ol>
<li><a href="#6_0">Programing Issues</a>
<ol>
***************
*** 169,175 ****
<table border="0" cellpadding="4" width="95%">
<tr bgcolor="#B0D0FF">
<th align="left">
- <h2> </h2>
<h2><a name="2_0">Java Feature Support</a></h2>
</th>
</tr>
--- 172,177 ----
***************
*** 201,226 ****
all of those native methods yourself, and make sure they behave exactly
as Sun's do. Note that they're undocumented! </dd>
</dl>
- <dl>
- <dt> </dt>
- <dd> </dd>
- </dl>
<dt> </dt>
<dd>To date Reflection is not supported, although all the required metadata
is included in Class.h.</dd>
- <dl>
- <dd>
- <dl>
- <dt> </dt>
- </dl>
- </dd>
- </dl>
- <dl>
- <dt>
- <dl>
- <dd></dd>
- </dl>
- </dt>
</dl>
<hr>
<h3><a name="2_2">2.2 </a>Does GCJ support using straight C native methods
--- 203,212 ----
all of those native methods yourself, and make sure they behave exactly
as Sun's do. Note that they're undocumented! </dd>
</dl>
<dt> </dt>
+ </dl>
<dd>To date Reflection is not supported, although all the required metadata
is included in Class.h.</dd>
</dl>
<hr>
<h3><a name="2_2">2.2 </a>Does GCJ support using straight C native methods
***************
*** 256,262 ****
</dt>
</dl>
<hr>
! <h3><a name="2_2">2.3 </a>Why does GCJ use CNI? </h3>
<blockquote>
<p><a href="mailto:per@bothner.com">Per Bothner</a> explains </p>
<blockquote>
--- 242,248 ----
</dt>
</dl>
<hr>
! <h3><a name="2_3">2.3 </a>Why does GCJ use CNI? </h3>
<blockquote>
<p><a href="mailto:per@bothner.com">Per Bothner</a> explains </p>
<blockquote>
***************
*** 275,281 ****
</blockquote>
<hr>
</dl>
! <h3><a name="4_4">2.4 What is the state of AWT support</a>?</h3>
<dl>
<dd> No support is currently in place for AWT. Prior Art which could be
used for this all require JNI. Possible starting points follow:
--- 261,267 ----
</blockquote>
<hr>
</dl>
! <h3><a name="2_4">2.4 What is the state of AWT support</a>?</h3>
<dl>
<dd> No support is currently in place for AWT. Prior Art which could be
used for this all require JNI. Possible starting points follow:
***************
*** 399,405 ****
</dl>
<dl>
<dt>
! <h3><a name="2_7">2.7 Can I contribute code from other Free Software
projects to supplement libgcj's current features?</a></h3>
</dt>
<dd> <font color="#FF6600">Can someone point me to some difinitive words
--- 385,391 ----
</dl>
<dl>
<dt>
! <h3><a name="2_7">2.7 Can I use any code from other OpenSource
projects to supplement libgcj's current features?</a></h3>
</dt>
<dd> <font color="#FF6600">Can someone point me to some difinitive words
***************
*** 413,419 ****
</dl>
<dl>
<dt>
! <h3><a name="2_8">2.8 What features of the Java language are/arn't supported.</a></h3>
</dt>
<dd>At the moment GCJ supports all Java language constructs as per the
<a href="http://java.sun.com/docs/books/jls/">Java language Specification
--- 399,405 ----
</dl>
<dl>
<dt>
! <h3><a name="2_8">2.8 What features of the Java language are/aren't supported.</a></h3>
</dt>
<dd>At the moment GCJ supports all Java language constructs as per the
<a href="http://java.sun.com/docs/books/jls/">Java language Specification
***************
*** 431,439 ****
</th>
</tr>
</table>
<dl>
<dt>
! <h3><a name="3_1">3.1 Linker bug on Solaris</a></h3>
</dt>
<p>
<dd>There is a known problem with the <a href="http://egcs.cygnus.com/ml/gcc-bugs/1999-10/msg00159.html">
--- 417,436 ----
</th>
</tr>
</table>
+
+ <dl>
+ <dt>
+ <h3><a name="3_1">3.1 I need something more recent than the last release; how should I build it?</a></h3>
+ </dt>
+ <p>
+ <dd>Please read <a href="build-snapshot.html">here</a>.
+ </dd>
+ <p></p>
+ </dl>
+
<dl>
<dt>
! <h3><a name="3_2">3.2 Linker bug on Solaris</a></h3>
</dt>
<p>
<dd>There is a known problem with the <a href="http://egcs.cygnus.com/ml/gcc-bugs/1999-10/msg00159.html">
*************** collect2: ld returned 1 exit status
*** 519,525 ****
<dt> </dt>
<dt><font color="#FF3300"></font></dt>
<dt>
! <h3><a name="4_4">4.3 "gcj -C"</a> Doesnt seem to work like javac/jikes.
Whats going on?</h3>
</dt>
<blockquote>
--- 516,522 ----
<dt> </dt>
<dt><font color="#FF3300"></font></dt>
<dt>
! <h3><a name="4_3">4.3 "gcj -C"</a> Doesnt seem to work like javac/jikes.
Whats going on?</h3>
</dt>
<blockquote>
*************** collect2: ld returned 1 exit status
*** 642,648 ****
<hr>
<dt> </dt>
<dt>
! <h3><a name="5_3">5.3 Can I profile Garbage Collection?</a></h3>
</dt>
<dd>It is possible to turn on verbose GC output by supressing the -DSILENT
flag during build. One way to do this is to comment out the line with
--- 639,645 ----
<hr>
<dt> </dt>
<dt>
! <h3><a name="5_4">5.4 Can I profile Garbage Collection?</a></h3>
</dt>
<dd>It is possible to turn on verbose GC output by supressing the -DSILENT
flag during build. One way to do this is to comment out the line with
*************** collect2: ld returned 1 exit status
*** 655,661 ****
<hr>
<dt> </dt>
<dt>
! <h3><a name="5_3">5.4 How do I increase the runtime's initial and maximum
heap sizes?</a></h3>
</dt>
<dd>Some programs that allocate many small, short-lived objects can cause
--- 652,658 ----
<hr>
<dt> </dt>
<dt>
! <h3><a name="5_5">5.5 How do I increase the runtime's initial and maximum
heap sizes?</a></h3>
</dt>
<dd>Some programs that allocate many small, short-lived objects can cause
*************** collect2: ld returned 1 exit status
*** 667,673 ****
<hr>
<dl>
<dt>
! <h3><a name="5_3">5.5 How can I profile my application?</a></h3>
</dt>
<dd>Support for this is currently lagging. Only single threaded Java code
may be used by the profiler (gprof). POSIX threads seem to be incompatible
--- 664,670 ----
<hr>
<dl>
<dt>
! <h3><a name="5_6">5.6 How can I profile my application?</a></h3>
</dt>
<dd>Support for this is currently lagging. Only single threaded Java code
may be used by the profiler (gprof). POSIX threads seem to be incompatible
*************** collect2: ld returned 1 exit status
*** 685,691 ****
<h3><a name="6_1"></a>6.1 Are there any examples of how to use CNI?</h3>
<blockquote>
<p><a href="mailto:tromey@cygnus.com">Tom Tromey</a> has created a couple
! of simple ezamples <a href="cni-1.txt">here</a> and <a href="cni-2.txt">here</a>.
</p>
<p>Another CNI example may be found here (thanks to Glenn Chambers!):
<a href="http://sourceware.cygnus.com/ml/java-discuss/1999-q3/msg00534.html">http://sourceware.cygnus.com/ml/java-discuss/1999-q3/msg00534.html</a>
--- 682,688 ----
<h3><a name="6_1"></a>6.1 Are there any examples of how to use CNI?</h3>
<blockquote>
<p><a href="mailto:tromey@cygnus.com">Tom Tromey</a> has created a couple
! of simple examples <a href="cni-1.txt">here</a> and <a href="cni-2.txt">here</a>.
</p>
<p>Another CNI example may be found here (thanks to Glenn Chambers!):
<a href="http://sourceware.cygnus.com/ml/java-discuss/1999-q3/msg00534.html">http://sourceware.cygnus.com/ml/java-discuss/1999-q3/msg00534.html</a>
-----------------build-snapshot.html-------------------
<html>
<head>
<title>How to build GCJ/LIBGCJ snapshots</title>
</head>
<body bgcolor="white" text="black" link="#0000EE" VLINK="#551A8B" ALINK="red">
<body bgcolor="#FFFFFF">
<table border="0" cellpadding="4" width="95%">
<tr bgcolor="#b0d0ff">
<th align="center">
<h2>Howto build and run libgcj/gcj snapshots</a>
</th>
</tr>
<tr bgcolor="cccccc">
<td>
<pre>
1. Get a GCC snapshots from
<a href="ftp://gcc.cygnus.com/pub/egcs/snapshots/index.html">ftp://gcc.cygnus.com/pub/egcs/snapshots/index.html</a>
They are made about once a week.
</pre>
</td>
</tr>
<tr bgcolor="dddddd">
<td>
<pre>
2. Get a Libgcj snapshots from
<a href="ftp://sourceware.cygnus.com/pub/java/snapshot">ftp://sourceware.cygnus.com/pub/java/snapshot</a>
They are made nightly.
</pre>
</td>
</tr>
<tr bgcolor="cccccc">
<td>
<pre>
3. Make a compile directory
$ mkdir compile
</pre>
</td>
</tr>
<tr bgcolor="dddddd">
<td>
<pre>
4. Move the snapshots into the compile dir, e.g.
$ cd compile
$ mv ../egcs-19991110.tar.gz .
$ mv ../libgcj-snapshot-1999-11-12.tar.gz .
$ gunzip *.gz
$ tar xfv *.tar
$ ln -s egcs-19991102 egcs
$ ln -s libgcj-snapshot-1999-11-12 libgcj
</pre>
</td>
</tr>
<tr bgcolor="cccccc">
<td>
<pre>
5. Compile and install egcs/gcj
$ cd egcs
$ mkdir objdir
$ cd objdir
$ ../configure --enable-threads=posix --prefix=/home/joerg/gcc \
--enable-java-gc=boehm --with-as=/opt/gnu/bin/as \
--with-ld=/opt/gnu/bin/ld
$ make bootstrap
$ make install
If you compile under Linux you could omit the last two options. Under
Solaris you'll need them. If you omit '--prefix' the compiled source will
be installed under /usr/local. For more information about installing
egcs and/or configuration options see:
<a href="http://egcs.cygnus.com/install/index.html">
http://egcs.cygnus.com/install/index.html</a>
</pre>
</td>
</tr>
<tr bgcolor="dddddd">
<td>
<pre>
6. Set the Path to the newly installed gcc
$ setenv PATH /home/joerg/gcc/bin:$PATH
Be sure to use the path with you gave the configure script
with '--prefix'.
Test the existence with
$ gcj -v
</pre>
</td>
</tr>
<tr bgcolor="cccccc">
<td>
<pre>
7. Compile and install libgcj
$ cd ../libgcj
$ mkdir objdir
$ cd objdir
$ ../configure --enable-threads=posix --prefix=/home/joerg/libgcj \
--enable-java-gc=boehm --with-as=/opt/gnu/bin/as --with-ld=/opt/gnu/bin/ld
Again, the last two options are needed for Solaris.
$ make
$ make install
Make sure you configured both gcj and libgjc with the same garbarge collector
and with the same thread package. If you use the default for gcj/egcs (no
configure option) you have to use --enable-java-gc=no for libgcj.
</pre>
</td>
</tr>
<tr bgcolor="dddddd">
<td>
<pre>
8. Adjust your environment
Edit a file env.csh:
setenv PATH /home/joerg/gcc/bin:$PATH
setenv LD_LIBRARY_PATH /home/joerg/libgcj/lib
setenv CLASSPATH /home/joerg/libgcj/share/libgcj.zip
$ source env.csh
</pre>
</td>
</tr>
<tr bgcolor="cccccc">
<td>
<pre>
9. If gcj complains about a missing libgcj.spec file copy it into your current directory
$ cp /home/joerg/libgcj/lib/libgcj.spec .
</pre>
</td>
</tr>
<tr bgcolor="dddddd">
<td>
<pre>
10. Edit a file HelloWorld.java
public class HelloWorld {
public static void main(String [] args) {
System.out.println("Hello");
}
}
</pre>
</td>
</tr>
<tr bgcolor="cccccc">
<td>
<pre>
11. Compile and run HelloWorld
$ gcj --main=HelloWorld -o HelloWorld HelloWorld.java
$ ./HelloWorld
</pre>
</td>
</tr>
</table>
</body>
</html>