?? faq.wml
字號:
<p>Giving the copyright to the FSF also gives us a clear paper trail where changes come from, which confirms our clean-room status.</p><p>The assignment contract commits the foundation to setting distribution termsthat permit free redistribution.</p><p>The assignment contract we normally use has a clause that permits you touse your code in proprietary programs, on 30 days' notice.(The 30 days' notice is there because, through a legal technicality,it would improve our position in a suit against a hoarder.)Although we believe that proprietary software is wrong, we include thisclause because it would serve no purpose to ask you to promise not to doit. You're giving us a gift in the first place.</p><p>You don't need to invoke this clause in order to distributecopies as free software under the GNU GPL, since everyone isallowed to do that.</p><p>See also <a href="http://www.gnu.org/licenses/why-assign.html">http://www.gnu.org/licenses/why-assign.html</a>.</p><p>For getting the assignment form, please send an e-mail with your name (asit appears in your passport) and your current postal address to themaintainer of GNU Classpath, Mark Wielaard <mark@klomp.org>.</p></faq><faq question="How do I install GNU Classpath?"><p>Follow these steps to install GNU Classpath. Please note that you need this only if you want to work directly with it; usually JVMs contain a pre-packaged version of GNU Classpath.<bold>Prerequisites</bold>Please check the exact version of the prerequisites from your release's INSTALL file.In every case, you need:<ul><li>GNU gmake<li>GNU autoconf<li>GNU automake<li>GNU libtool</ul>For building the Java bytecode (.class files), one of these compilers are required. You can select which compiler using --with-jikes, --with-gcj or --with-kjc as argument to configure; the present default is gcj.<ul><li>GCJ (part of GNU GCC)<li>IBM Jikes</ul>For building the JNI native libraries, the following are required unless --disable-gtk-peer is used as an argument to configure.<ul><li><createlink name="GTK+ 2" url="http://www.gtk.org/"><li>gdk-pixbuf</ul>For building the documentation you will need:<ul><li>texinfo</ul><bold>Install from CVS</bold><commented-code><code-line code="cvs checkout" /><code-line code="./autogen.sh" /><code-line code="./configure" /><code-line code="make" /></commented-code><bold>Install a release</bold><commented-code><code-line code="<createlink url="ftp://ftp.gnu.org/gnu/classpath/">"> Download the current release</code-line><code-line code="tar zxf classpath-<i>version</i>.tar.gz"> unpack</code-line><code-line code="cd classpath-<i>version</i>" /><code-line code="more INSTALL"> make sure you have all pre-requirements</code-line><code-line code="./configure"> configure the distribution; use <code>--help</code> to get the list of options: you will usually need <code>--prefix=<i>dest/dir/for/classpath</i>; use <code>--disable-gtk-peer</code> if you don't use gtk+/gnome.</code-line><code-line code="make; make install" /></commented-code></faq><faq question="How do I install Mauve?"><commented-code><code-line code="export CVSROOT=:ext:anoncvs@bogus.example.com:/cvs/mauve" /><code-line code="cvs login">password is anoncvs</code-line><code-line code="cvs checkout mauve" /><code-line code="cd mauve" /><code-line code="./configure">The main thing this does is creating the gnu/testlet/config.java. You could also do this by hand from the config.java.in file</code-line><code-line code="vi batch_runner">Edit the script 'batch_runner' to set the variable COMPILER correctly (there are a couple of example settings)</code-line><code-line code="vi runner">Edit script 'runner' to set the variable RUNTIME correctly (there are a couple of example settings)</code-line><code-line code="./batch_run">run ./batch_run and look at the results. You can also run individual tests with<br><code>- echo gnu.testlet.java.lang.String.getBytes | jamvm gnu.testlet.SimpleTestHarness</code><br>(Option flags are -verbose and -debug)</code-line></commented-code></faq><faq question="How can I synchronize my sources with GNU Classpath?">When developing a JVM that uses GNU Classpath, a copy of GNU Classpath local to the JVM is often used. To keep the Classpath sources synchronized with the main development, a few approaches are possible (we assume here that you are keeping the local copy of Classpath in your JVM revision control software):<ul><li>Use CVS import and CVS update as explained in <createlink url="http://www.cvshome.org/docs/manual/cvs-1.11.14/cvs_13.html#SEC104" name="Section 13: Tracking Thirdparty sources"> of the CVS manual. This works well for minor changes, but has the disadvantage of a limited control on the update / merge of the sources. In fact, most of the developers prefer merging the changes by hand.<li>libgcj, which is almost always trying to beas synchronized as possible with GNU Classpath CVS, has a scriptthat runs daily which produces a (colored) differences overview(including patch/diffs). They also put in special markers into thesource for gcj specific changes that the script recognizes.<ul><li>Script can be found at:<createlink url="http://savannah.gnu.org/cgi-bin/viewcvs/gcc/wwwdocs/bin/gen-classpath-compare"><li>Daily updated result:<createlink url="http://gcc.gnu.org/java/libgcj-classpath-compare.html"></ul></ul></faq><faq question="How do I avoid compiling some files or packages?">The file <code>lib/standard.omit</code> controls which files are omitted from the compilation. Add a regex with the files to be omitted and rebuild classpath.</faq><faq question="How do I change classpath's web pages?"><p>To modify and upload GNU Classpath's web pages, you need write access to the CVS. First, checkout the modules "classpath" and "website".<p>The web pages are stored in doc/www.gnu.org and are written in wml (Web Meta Language, see <createlink url="http://thewml.org/">).<p>A typical page usually looks like this:<pre>\#include "include/layout.wml"<subject "here goes the page title"><box><boxtitle>Section 1 Title<\boxtitle><boxitem> section 1 contents<\boxitem>....<\box></pre><p>Invoking "make" creates the html pages in the same directory. To copy those pages to another directory, use<pre>> export CLASSPATH_WEBROOT=...destination...> make publish</pre><p>The steps to publish the pages are:<ol><li>Update ChangeLog<li>Commit your changes in module Classpath to the CVS<li>cd doc/www.gnu.org<li>make<li>copy the modified / new pages to the website module<li>commit the changes in the website module</ol><p>Note that it takes up to an hour for the pages to appear on the GNU website after an upload.</faq><faq question="Is it possible to use Classpath in a prorietary VM?"><p>Only the proprietary VM's vendor can make it work with GNU Classpath, by the nature of the VM being proprietary. GNU Classpath provides well documented and widely used interfaces for interfacing with runtimes. It's up to proprietary VM vendors to make their products work with GNU Classpath, if they wish to do so. If you, as a customer, want the runtime to use GNU Classpath, please talk to your proprietary software vendor. <p>You can also try using a free runtime that supports GNU Classpath out-of-the-box instead.</faq></faq-section><faq-section name="Classpath Implementation"><faq question="Why does java.lang.Throwable delay the StackTrace array construction?">Well consider what happens in a VM. VMThrowable.fillInStackTrace() isvery fast -- it's just a chain of addresses.VMThrowable.getStackTrace() is very slow, because it has to convertall those addresses into StackTraceElements. I suspect that you canget the trace for the whole stack in less time than it takes to createa single StackTraceElement. For this reason, the vmState is storedand lazily converted to a StackTraceElement[]. (<i>Andrew Haley</i>)<p> A particular problem is posed by OutOfMemoryException: throwing it shouldn't require any memory (there's none anyway). Some propose that the VM should preallocate it at bootstrap, but this doesn't solve the problem. In Chris Gray's words <i>"if several threads throw OOME at the same time, the stack traces can get mixed up [...snip...] This situation is less improbable than you might think, since if one thread encounters an OOM situation, all other threads should encounter one too. With some forms of co-operative multi-threading you may get away with it, but in the general pre-emptive case you could be living dangerously."</i></p></faq></faq-section><faq-section name="Varia"><faq question="How to generate API Documentation with gjdoc/libxmlj?">Beware: generating the complete API Documentation non-trivial and the generation of a full tree takes more then one and half hour (on a 1.4 Ghz Athlon),150+ MB of memory, at least 25MB of tmp storage, and at leasttwice so much in your obj build dir.<ol><br><li>set the CVS_RSH environment variable to ssh<br><br><li>install gcj 3.3.2 (or higher)<br><code>gjdoc CVS :ext:anoncvs@savannah.gnu.org:/cvsroot/cp-tools module gjdoc</code><br><li>install libxmlj<br><code>libxmlj CVS :ext:anoncvs@savannah.gnu.org:/cvsroot/classpathx module libxmlj<br>make && make install</code><br><li>For gjdoc add at the start of gnu/classpath/tools/gjdoc/Main.java (main):<br><code> System.setProperty("javax.xml.transform.TransformerFactory", "gnu.xml.libxmlj.transform.TransformerFactoryImpl");</code><br><li>There is a ant build.xml file, but you can also compile it all by hand together with the external/jaxp/source files from Classpath which can be copied in the src direcrory as follows:<br><code> find * -name \*.java | xargs gcj -O2 -g -o gjdoc \<br> --main=gnu.classpath.tools.gjdoc.Main</code><br><li>Create a simple gjdoc script and put it in your PATH:<br><code> #!/bin/sh<br> CLASSPATH=/home/mark/src/libxmlj:/home/mark/src/gjdoc/src/resources \<br> LD_LIBRARY_PATH=/usr/local/libxmlj/lib \<br> /home/mark/src/gjdoc/src/gjdoc $*</code><br><li>Configure classpah with --enable-gjdoc.<br><li>Type make and go get yourself some coffe, take a shower and do some work in the garden.</ol><p>There is one catch. The above setup is completely broken for some HTMLentities (see [bugs #4823] HTML entities such as auml and nbsp should beput back in the API doc). So if you have spectacular and mysteriouscrashes then make sure that your java source files don't contain suchentities.<p>Alternatively, you may also try the following command (the one used to generate the doc on <createlink url="http://developer.classpath.org/doc/">):<br><ul><code>$(GJDOC) -public -use \<br> -sourcepath "$(sourcepath)" \<br> -encoding UTF-8 \<br> -breakiterator \<br> -licensetext \<br> -linksource \<br> -splitindex \<br> -d html \<br> -doctitle "GNU Classpath $(VERSION)" \<br> -windowtitle "GNU Classpath $(VERSION) Documentation" \<br> -header $(classpathbox) -footer $(classpathbox) \<br> -subpackages java:javax:org</code></ul></faq></faq-section></box>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -