java-linux@java.blackdown.org FAQ <AUTHOR> by Stephen Wynne <DATE> November 15, 1998 <ABSTRACT> This document attempts to answer the most commonly-asked questions on the <HTMLURL URL="mailto:java-linux@java.blackdown.org" NAME="java-linux@java.blackdown.org"> mailing list. Its focus is the Blackdown JDK. More information on running Java on Linux is available at <HTMLURL URL="http://www.blackdown.org/java-linux.html" NAME="http://www.blackdown.org/java-linux.html">. </ABSTRACT> <TOC> <P> <VERB> $Id: 00-header.sgml,v 1.3 1998/11/15 22:07:11 stevemw Exp $ </VERB> <SECT> Introduction to the Blackdown JDK and Mailing List User Guide <P> This section answers introductory questions about the Blackdown JDK and also provides an orientation for new mailing list participants. We hope you take a minute to read this before posting! <SECT1> Last Update <P> <VERB> $Id: 01-intro.sgml,v 1.4 1998/11/15 22:05:40 stevemw Exp $ </VERB> <SECT1> What is the Blackdown JDK? <P> The Blackdown JDK is one of the ports of Sun's Java Developer's Toolkit to Linux. The JDK includes the basic tools needed for developing and running Java applications, including (among other things) the following: <ITEMIZE> <ITEM> A Java Virtual Machine, or JVM. The virtual machine interprets and executes Java byte codes (a more condensed, intermediate form for Java instructions) inside a software-only machine. In other words, the JVM emulates a hardware platform, including registers, program counter, and so forth. <ITEM> A Java compiler, which takes a text file containing Java syntax and transforms it into Java byte codes. <ITEM> An appletviewer for executing Java applet code. <ITEM> A Java debugger. <ITEM> Example Java programs. <ITEM> The Java 1.1 class library, including platform-independent library source. <ITEM> A tool for creating and managing Java security keys. <ITEM> A remote method stub and skeleton generator. <ITEM> A registry server for remote method invocations. <ITEM> C and C++ headers for extending the JVM with interfaces to native code. <ITEM> Native libraries for the platform-dependent portions of the JVM, including AWT layer above Motif and X11. <ITEM> Native libraries for embedding a JVM in other native applications. </ITEMIZE> There are static and dynamic versions of the core Java binaries, as well as versions compiled with and without debugging symbols. Documentation for the JDK APIs is available separately from Javasoft at <HTMLURL URL="http://www.javasoft.com/docs/" NAME="http://www.javasoft.com/docs/">. <P> For information on the Blackdown JDK porting project itself, including who the major contributors have been, please see section <REF NAME="Who Ported the Blackdown JDK?" ID="jdk-porters"> . <SECT1> Suggestions for List Participants <P> <ITEMIZE> <ITEM> Please read <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/README.linux.txt" NAME="http://www.place.org/˜stevemw/java/FAQ/README.linux"> (also found in the Blackdown JDK distribution). <ITEM> Choose a descriptive <BF>Subject:</BF> line for your mail. <ITEM> When reporting problems, please follow the guidelines in section <REF ID="submit-bugs-howto" NAME="What Should I Report?">. <ITEM> Posts with lines wrapped at 75-80 characters are easier to read! <ITEM> Spamming the list or using members' E-mail addresses for commercial purposes is forbidden. <ITEM> Some list users may ignore messages created in HTML or that include proprietary attachments. <ITEM> Do not followup improper postings to the entire list; copy <EM>only</EM> the sender and <HTMLURL URL="mailto:karl@blackdown.org" NAME="Karl Asha <karl@blackdown.org>">, the list administrator. <ITEM> Please avoid inflammatory language. </ITEMIZE> <SECT1> OK Then, What Topics Are Appropriate? <P> <HTMLURL URL="mailto:nelson@media.mit.edu" NAME="Nelson Minar <nelson@media.mit.edu>"> makes this suggestion: <QUOTE> Please only post things that are related to Java <IT>and</IT> Linux to the java-linux mailing list. If you have general Java questions or general Linux questions, please find a more appropriate group. The quality of discussion on java-linux is very high, and it may be tempting for you to post a generic question there because you can get help. But please don't -- if we water down the mailing list with non-java-linux questions, the list will be spoiled for all. </QUOTE> <SECT1> How can I get subscribed? Unsubscribed? <P> Please don't send E-mail directly to the list requesting these status changes! Visit <HTMLURL URL="http://www.blackdown.org/java-linux.html" NAME="http://www.blackdown.org/java-linux.html"> and follow the links to instructions or use the links provided in the next paragraph. <P> The following URL would work in Netscape Mail to subscribe you: <HTMLURL URL="mailto:java-linux-request@java.blackdown.org?subject=subscribe" NAME="java-linux-request@java.blackdown.org?subject=subscribe"> <P> And this should unsubscribe: <HTMLURL URL="mailto:java-linux-request@java.blackdown.org?subject=unsubscribe" NAME="java-linux-request@java.blackdown.org?subject=unsubscribe"> <SECT1> Where Can I Find Archived Postings from this List? <P> Karl Asha has arranged for the list to be archived here: <HTMLURL URL="http://www.mail-archive.com/java-linux@java.blackdown.org/" NAME="http://www.mail-archive.com/java-linux@java.blackdown.org/">. <SECT> An Overview of the Blackdown JDK <P> This tries to answer several broad questions about running the Blackdown JDK on Linux. <SECT1> Last Update <P> <VERB> $Id: 02-overview.sgml,v 1.5 1998/11/15 22:29:17 stevemw Exp stevemw $ </VERB> <SECT1> Could You Give Me An Overview of Running Java on Linux? <P> Running Java on Linux is about what you'd expect. You should be able to run most "pure Java" applications on the Linux JDK or JRE. It does take a little longer to get the latest JDK on a target that Javasoft doesn't officially support. <SECT1> What is the Currently-supported Version of the Blackdown JDK? <P> <LABEL ID="supported-jdk-version"> At the time of this writing, the latest supported Blackdown JDK version is <BF>1.1.7v1a</BF>. Please see section <REF ID="jdk-download" NAME="Where to obtain JDK 1.02 and 1.1?"> for places to download. To determine your version, use this command: <CODE> $ java -version </CODE> <SECT1> What System Configuration do I Need to Run the JDK? <LABEL ID="system-requirements"> <P> This is only a basic summary. The Alpha, SPARC, and PPC platforms may have different requirements, for example. <ENUM> <ITEM> A supported platform running regular, 32-bit Linux is required. See section <REF ID="version-to-download" NAME="OK, Which Version of the JDK Should I Download?"> for details. <ITEM> You need at a minimum, 20MB of free virtual memory to run the JDK. See section <REF ID="adding-swap" NAME="How Do I Add Swap Space?"> for more information. <ITEM> Including HTML documentation and <TT>i18n.jar</TT>, JDK 1.1.7 <TT>i386 glibc</TT> version takes about 70MB of free space if you include the native threads pack. You can make it smaller by removing these and the demos. <ITEM> To run AWT, you'll need X11 up and running. <ITEM> Sound cards are supported but not required. </ENUM> <SECT1> OK, Which Version of the JDK Should I Download? <LABEL ID="version-to-download"> <P> This section closely matches the organization of the Blackdown distribution mirror hierarchy. This part of the FAQ is rather thin on details at the moment, but it should help you to see which archive to retrieve. You may also be interested in reading section <REF ID="system-requirements" NAME="What System Configuration do I Need to Run the JDK?"> above. After reading this, if you're still wondering which individual archive to download, please see <REF ID="what-are-these-files" NAME="What are These Files?"> below. <SECT2> JDK 1.02 <P> The Blackdown version of the JDK is only supported on Intel. If you know of other Linux platforms to which the JDK has been ported, please tell the FAQ maintainer. Look for the mirror closest to you by following instructions in section <REF ID="jdk-download" NAME="Where to obtain JDK 1.02 and 1.1?">. <SECT2> JDK 1.1 <P> <ITEMIZE> <ITEM> <BF>Alpha</BF> <NEWLINE><TT> ................................ alpha/</TT> <ITEM> <BF>Intel x86</BF> <NEWLINE><TT> ................................ i386/</TT> <ITEM> <BF>SPARC</BF> <NEWLINE><TT> ................................ sparclinux/</TT> <ITEM> <BF>PowerPC</BF> <NEWLINE><TT> ................................ mklinux/</TT> <ITEM> <BF>Patches to Javasoft Source, etc...</BF> <NEWLINE><TT> ................................ common/</TT> </ITEMIZE> You may wish to read section <REF ID="glibc-libc5" NAME="What is glibc, and Why Does it Matter?"> to help you understand which Intel JDK to download. <P> For an official description of the FTP site, look for an up to date version of <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/README.ftp.txt" NAME="README.ftp.txt">, at the top level of your closest mirror. <P> To just run the JDK, you don't need anything out of <TT>common/</TT>. Those <BF>diff(1)</BF> files are for people who want to request free access to the <BF>SPARC/x86 Solaris</BF> and <BF>i386 Win32</BF> sources from Sun and help with the port. See section <REF ID="jdk-building" NAME="Compiling the Blackdown JDK from Source"> for more information. <SECT1> What are These Files? <LABEL ID="what-are-these-files"> <P> By now, many readers are still wondering what each archive in the mirror directories is. Below is a representation of what your favorite web browser would have displayed if you were visiting a Blackdown JDK mirror recently. <CODE> Current directory is /pub/java-linux/JDK-1.1.7/i386/glibc/v1a Up to higher level directory README-1.1.7v1a.txt README.native_threads.txt i18n_1.1.7-v1a-glibc-x86.tar.bz2 i18n_1.1.7-v1a-glibc-x86.tar.gz jdk_1.1.7-v1a-glibc-x86-native.tar.bz2 jdk_1.1.7-v1a-glibc-x86-native.tar.gz jdk_1.1.7-v1a-glibc-x86.tar.bz2 jdk_1.1.7-v1a-glibc-x86.tar.gz jre_1.1.7-v1a-glibc-x86-native.tar.bz2 jre_1.1.7-v1a-glibc-x86-native.tar.gz jre_1.1.7-v1a-glibc-x86.tar.bz2 jre_1.1.7-v1a-glibc-x86.tar.gz rt_1.1.7-v1a-glibc-x86-native.tar.bz2 rt_1.1.7-v1a-glibc-x86-native.tar.gz rt_1.1.7-v1a-glibc-x86.tar.bz2 rt_1.1.7-v1a-glibc-x86.tar.gz </CODE> At this point, you've already decided that your system is based on <TT>glibc</TT> (perhaps by reading <REF ID="glibc-libc5" NAME="What is glibc, and Why Does it Matter?">). Now you'd like to know what these four files do for you, and which ones you should download. <ENUM> <ITEM> <BF>jdk</BF>. The JDK contains everything you need to run Java, compile Java, and debug java. It doesn't contain the international character converters (see i18n). <ITEM> <BF>jre</BF>. The JRE is the Java runtime environment, including the international character converters. <ITEM> <BF>rt</BF>. The Java RT is the minimal configuration you can have to run Java. It doesn't contain any internationalization support. <ITEM> <BF>i18n</BF>. This contains font mappings and a JAR file containing the international character converters, and really doesn't need to be split off by library type, but is anyway. <ITEM> <BF>*native*</BF>. These are additional binaries that provide support for native threads (according to command-line options and environment variables). See the section <REF ID="native-threads" NAME="Is There a Native Threads Port of the Blackdown JDK?"> for a little more information. </ENUM> <SECT1> What Other JDK Ports are Available for Linux? <P> Please see section <REF ID="non-intel-ports" NAME="Questions about Non-i386 Blackdown JDK Ports"> for more information. <HTMLURL URL="http://www.blackdown.org/java-linux/ports.html" NAME="http://www.blackdown.org/java-linux/ports.html">. <SECT1> There's a pure Java Package I Want to Run. Can I? <P> Most likely. For example, I've tested Javasoft's JFC SwingSet (see <HTMLURL URL="http://java.sun.com/products/jfc/" NAME="http://java.sun.com/products/jfc/">) with a static Motif build and a Lesstif build with good results. <P> This typically involves downloading the package and untarring or unzipping it. Sometimes the vendor won't provide an installation procedure that works well on Linux, and so you have to adjust a script or do it by hand. <SECT1> When is the JDK 1.2 Going to be Released for Linux? <P> Sometime shortly after Javasoft's reference port. The Blackdown team has the sources and is working on porting it. <SECT1> Can I Take a Look at the JDK 1.2 on Linux Now Anyway? <P> After a fashion. Just run <TT>unzip</TT> on the Solaris shell script archive; it'll unpack it for you. You can then unpack the <TT>src.zip</TT> archive. Also, you can already get the documentation from Javasoft from <HTMLURL URL="http://www.javasoft.com/docs/index.html" NAME="http://www.javasoft.com/docs/index.html">. <SECT1> Is Javasoft Going to Support Java on Linux? <P> We still don't know about full support yet. At one point, bug 4097810 was at the top of the JDC Bug Parade. You can read about it at: <HTMLURL URL="http://developer.java.sun.com/developer/bugParade/bugs/4097810.html" NAME="http://developer.java.sun.com/developer/bugParade/bugs/4097810.html">. <P> There are a number of complex issues involved with this request, including the wide variety of Linux distributions, target architectures (beyond Intel where Javasoft already supports Solaris x86), the huge number of announced APIs with required native support, and so forth. <P> However, Javasoft has released the JDK 1.2 sources to the Blackdown team, and is providing measured engineering resources to help complete the port. You can read more about this in a press-release published on Javasoft's website. See <HTMLURL URL="http://www.javasoft.com/pr/1998/11/pr981102-01.html" NAME="http://www.javasoft.com/pr/1998/11/pr981102-01.html">. <SECT1> What are Green Threads? <LABEL ID="green-threads"> <P> Green threads use some magic with <TT>jmp_buf</TT>s, stack pointers, the program counter, and some other hocus pocus to schedule different instruction streams. This gives the practical effect of multi-threading with some caveats about signals and how they're handled across <TT>longjmp()</TT>s. See the discussion of native threads in section <REF ID="native-threads" NAME="Is There a Native Threads Port of the Blackdown JDK?">. <SECT1> Is There a Native Threads Port of the Blackdown JDK? <LABEL ID="native-threads"> <P> Yes, thanks to Phill Edwards. See the file <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/README.native_threads.txt" NAME="README.native_threads.txt">. Up to date versions of this file are available at your closest mirror. <P> Native threads should improve performance on multi-processor (SMP) systems and they tend to make native method invocation support easier to deal with. They depend on kernel processes, and therefore are limited to the number compiled into a given kernel. <P> Here's an excerpt from the threads README to help you get started: <VERB> To use the native threads package, you must first install the matching JDK release. Then, the matching native thread package must be installed at the same location. This package adds some directories to the JDK tree. For example, the x86 install would best be done as: % tar -zxf jdk_1.1.7-v1a-x86-glibc.tar.gz % tar -zxf jdk_1.1.7-v1a-x86-glibc-native.tar.gz This will make the JDK directory tree in "jdk117_v1a" </VERB> You can find more information about related command-line options and environment variables in that README. <SECT1> Does Javasoft's Activator JVM work on Linux with Netscape? <P> Take a look at <HTMLURL URL="http://www.blackdown.org/activator/" NAME="http://www.blackdown.org/activator/">. This is a random port (from Sun) of the Java Activator Plugin for Netscape. Note that this one-time build isn't at all supported, and that Blackdown developers don't have source for it. <SECT1> Is there a JIT (Just in Time Compiler) for the Blackdown JDK? <P> There are several. Please take a look at <HTMLURL URL="http://www.blackdown.org/java-linux/javatools.html" NAME="http://www.blackdown.org/java-linux/javatools.html"> for pointers. <P> <HTMLURL URL="mailto:alex@Javad.Ru" NAME="Alexander Davydenko <alex@Javad.Ru>"> posted an updated <TT>configure</TT> script to install TYA that this author hasn't tested. You can read his post at <HTMLURL URL="http://www.mail-archive.com/java-linux@java.blackdown.org/msg00126.html" NAME="http://www.mail-archive.com/java-linux@java.blackdown.org/msg00126.html"> . <SECT1> What Other Java Resources are Available at Blackdown? <P> Karl Asha's Blackdown server, <HTMLURL URL="http://www.blackdown.org/java-linux.html" NAME="http://www.blackdown.org/java-linux.html">, has a number of resources. Among other things, Karl provides the following pointers: <ITEMIZE> <ITEM> Recent news about running Java on Linux: <HTMLURL URL="http://www.blackdown.org/java-linux/info.html" NAME="http://www.blackdown.org/java-linux/info.html"> <ITEM> Javasoft-supplied products: <HTMLURL URL="http://www.blackdown.org/java-linux/products.html" NAME="http://www.blackdown.org/java-linux/products.html"> <ITEM> Java Tools: <HTMLURL URL="http://www.blackdown.org/java-linux/javatools.html" NAME="http://www.blackdown.org/java-linux/javatools.html"> <ITEM> Information about Third-party Java products running on Linux: <HTMLURL URL="http://www.blackdown.org/java-linux/otherproducts.html" NAME="http://www.blackdown.org/java-linux/otherproducts.html"> </ITEMIZE> <SECT1> Other Sources of Information about Java on Linux <P> <ITEMIZE> <ITEM> Levente Farkas maintains Java RPMs and Java-Linux related links: <HTMLURL URL="http://anna.inf.u-szeged.hu/java/java-rpm.html" NAME="http://anna.inf.u-szeged.hu/java/java-rpm.html"> <ITEM> Slashdot mentions Java frequently. <HTMLURL URL="http://slashdot.org/" NAME="http://slashdot.org/"> <ITEM> Freshmeat is interesting, as well. <HTMLURL URL="http://freshmeat.net/" NAME="http://freshmeat.net/"> <ITEM> Check out the GNU Java page! <HTMLURL URL="http://www.gnu.org/software/java/java.html" NAME="http://www.gnu.org/software/java/java.html"> </ITEMIZE> <SECT>Blackdown JDK Installation Questions <P> This section addresses questions about installing the Blackdown JDK. <SECT1> Last Update <P> <VERB> $Id: 03-install.sgml,v 1.1 1998/11/13 02:32:50 stevemw Exp $ </VERB> <SECT1> Where to obtain JDK 1.02 and 1.1? <LABEL ID="jdk-download"> <P> Please visit <HTMLURL URL="http://www.blackdown.org/java-linux/mirrors.html" NAME="http://www.blackdown.org/java-linux/mirrors.html"> and select the site nearest you. Both Randy Chapman's JDK 1.02 and Steve Byrne's JDK 1.1.x are found on participating mirror sites. Check section <REF ID="supported-jdk-version" NAME="What is the Currently-supported Version of the Blackdown JDK?"> for the currently supported version the Blackdown JDK. <SECT1> How Do I Install the JDK? <P> <ENUM> <!-- Thu May 28 05:04:49 PDT 1998 --> <ITEM> Download the <BF>tar(1)</BF> archive for your platform as directed by the mirror list mentioned in section <REF ID="jdk-download" NAME="Where to obtain JDK 1.02 and 1.1?">. <ITEM> Move to an appropriate directory and for example, unpack the <BF>tar(1)</BF> archive as follows: <CODE> $ cd /usr/local $ tar zxvf /tmp/jdk1.1.6.tar.gz </CODE> <ITEM> Make sure your DISPLAY environment variable is set, put the resulting directory into your execution path, and try something: <CODE> $ export DISPLAY=:0 $ export PATH=/usr/local/jdk1.1.6/bin:$PATH $ appletviewer \ /usr/local/jdk1.1.6/demo/awt-1.1/lightweight/OpenlookButtons/example.html </CODE> </ENUM> Note that the above examples assumed you were using the Bash shell, such as <TT>/bin/bash</TT>. Also note that if you already have a <TT>CLASSPATH</TT> set, you'll probably want <!-- We're dealing with groff on the other end, so ".", can't start a line --> to append <TT>.:/usr/local/jdk1.1.6/lib/classes.zip:</TT> to that environment variable. This ensures that you have the current working-directory in your class search path, and makes things much easier for you as you test your code. <P> Of course you may want to add these environment commands to your shell's startup script, such as <TT>$HOME/.bashrc</TT>. <P> Some people may wish to set <TT>JAVA_HOME</TT> themselves. That way, you can change all commands following setting that to use it instead, such as <CODE> $ export JAVA_HOME=/usr/local/jdk1.1.6 $ export PATH=$JAVA_HOME/bin:$PATH $ export CLASSPATH=.:$JAVA_HOME/lib/classes.zip </CODE> <SECT> Troubleshooting the Blackdown JDK on Linux <P> This section attempts to answer your initial questions when you're trying to solve problems with the Blackdown JDK. <SECT1> Last Update <P> <VERB> $Id: 04-trouble.sgml,v 1.2 1998/11/13 02:50:16 stevemw Exp $ </VERB> <SECT1> Typical Questions to Ask Yourself When Debugging Problems <P> <ITEMIZE> <ITEM> <BF>Does your system hardware and software satisfy the minimum requirements?</BF> See section <REF ID="system-requirements" NAME="What System Configuration do I Need to Run the JDK?">. <ITEM> <BF>Are you running the current version?</BF> <!-- Thu May 28 05:04:49 PDT 1998 --> You can find that information in section <REF ID="supported-jdk-version" NAME="What is the Currently-supported Version of the Blackdown JDK?">. <ITEM> <BF>Have you checked to see if your libc, glibc, and X11 libraries could be the problem?</BF> See section <REF ID="dist-specific" NAME="Details on Running The Blackdown JDK">. If you learn something we can add to there, please post them! <ITEM> <BF>Environment Variables.</BF> <LABEL ID="env-problems"> Here are the top candidates for problems: <NEWLINE> <ITEMIZE> <ITEM> <TT>CLASSPATH</TT><NEWLINE> Should either be unset or start with <TT>.:$JAVA_HOME/lib/classes.zip</TT>. <ITEM> <TT>PATH</TT><NEWLINE> Should include <TT>$JAVA_HOME/bin</TT> -- ahead of <TT>/usr/bin</TT> where Kaffe often lives, <EM>please!</EM> <ITEM> <TT>JAVA_HOME</TT><NEWLINE> This should be set to your top-level JDK directory. <ITEM> <TT>JDK_HOME</TT><NEWLINE> Although the JDK doesn't need this, it ought to be set to your top-level JDK directory (if at all). HotJava uses this environment variable, as do other packages other than the JDK. </ITEMIZE> <ITEM> <BF>Are all the required X11 fonts installed?</BF> <NEWLINE> This is a subtle area of concern. People have experienced crashes from not having 75dpi fonts installed. <ITEM> <BF>Are your font and localization properties correct?</BF> <NEWLINE> Another area that is difficult to troubleshoot. I hope to add more information here soon! </ITEMIZE> <SECT1> Kaffe and the Blackdown JDK 1.1 are Installed. Neither Work! <P> After running <P> <TT>javac HelloWorld.java</TT> <P> and seeing this message: <P> <TT>Failed to open object 'HelloWorld/java'</TT> <P> Other people have reported error messages such as these: <VERB> $ javac Failed to locate native library in path: /usr/lib Aborting. </VERB> <HTMLURL URL="mailto:danlugli@tin.it" NAME="Daniele Lugli <danlugli@tin.it>"> reports: <VERB> ...The javac which was giving the problem was /usr/bin/javac, that is the kaffe javac. Now that I moved $JAVA_HOME/bin ahead in my $PATH, both javac and java work, and I see a wonderful "Hello, World!". </VERB> In other words, always check for conflicting environment variable problems. For details on how to do this, see section <REF ID="env-problems" NAME="Environment Variables">. <P> A very common cause for problems with Kaffe is having <TT>/usr/bin</TT> in your path ahead of <TT>$JAVA_HOME/bin</TT>. <SECT1> I Have the Blackdown JDK 1.1.x and RMI is Giving Me Fits! <!-- Thu May 28 05:04:49 PDT 1998 --> <P> <HTMLURL URL="mailto:richmc@entropy.ucsc.edu" NAME="Rich McClellan <richmc@entropy.ucsc.edu>"> reports that running the Blackdown <BF>JDK 1.1.5v7libc</BF> works better than the glibc version, and forwards this advice from <HTMLURL URL="mailto:akonstan@cs.columbia.edu" NAME="Alexander V. Konstantinou <akonstan@cs.columbia.edu>">: <VERB> The problem is related to naming in /etc/hosts. This is a known Java problem in picking up the right name for the interface. Change the localhost name to your real machine name. This may cause problems with talk though ... </VERB> <!-- Sun Aug 16 11:55:23 PDT 1998 --> <SECT1> Help, I've Upgraded to ld.so-1.9.9 and Now the JDK Coredumps! <P> Slackware users have found that removing the <TT>libdl.so.*</TT> and <TT>libc.so.*</TT> files from <TT>$JAVA_HOME/lib/i386/green_threads</TT> takes care of this problem. We don't know what causes it yet, though. <SECT1> Help, Java Said it Ran out of Memory! <P> You have two strong candidates as causes for this problem. <ENUM> <ITEM> Your program needs more than the default that the JVM allows. Memory limits can be set like this: <TT>java -ms16m -mx64m ...</TT>. From the JDK documentation: <VERB> -ms<number> set the initial Java heap size -mx<number> set the maximum Java heap size </VERB> <ITEM> You actually don't have enough virtual memory (the total of physical RAM and swap space) available. The <TT>free</TT> command can help you there. See the manual page for <BF>free(1)</BF>. For the current minimum system requirements, see the discussion of them in section <REF ID="system-requirements" NAME="What System Configuration do I Need to Run the JDK?">. </ENUM> <LABEL ID="adding-swap"> <SECT1> How Do I Add Swap Space? <P> See the manual pages for <BF>swapon(8)</BF> and <BF>mkswap(8)</BF>. <SECT1> Where Can I Report Bugs? <P> Karl Asha has setup a <HTMLURL URL="http://samba.anu.edu.au/jitterbug/" NAME="Jitterbug"> problem-report form at <HTMLURL URL="http://www.blackdown.org/cgi-bin/jdk" NAME="http://www.blackdown.org/cgi-bin/jdk">. Please report problems by filling this in as best you can. There are some guidelines for this in section <REF ID="submit-bugs-howto" NAME="What Should I Report?">. <P> Before submitting a bug, you may be able to help by visiting Javasoft's Bug Parade at <HTMLURL URL="http://developer.java.sun.com/developer/bugParade/bugs/" NAME="http://developer.java.sun.com/developer/bugParade/bugs/"> and checking for related problems. If you mention a bug from a JDC bug ID in your problem report, it can help Blackdown JDK developers. At this time, you will have to join the JDC in order to search this database. <P> As usual, feel free to open a discussion about your problems on the <HTMLURL URL="mailto:java-linux@java.blackdown.org" NAME="java-linux@java.blackdown.org"> mailing list. <SECT2> What Should I Report? <LABEL ID="submit-bugs-howto"> <P> Although it may not seem so, solving Linux JDK problems can sometimes be difficult because of the large variation of systems that are in use. Please do your best when reporting a bug to tell us all about your system, the code you're running, and anything else that can help. Here's a checklist of items to mention. <ENUM> <ITEM> A careful synopsis of the problem. <ITEM> Which JDK you're using. Type <TT>java -version</TT> to see. <ITEM> Your Linux distribution (i.e. RedHat) and its version. <ITEM> The LibC version you're using. Type <TT>ldconfig -D 2>&1 | grep libc | tail -1</TT> to see. <ITEM> The loader you're running. Type <TT>ldconfig -D 2>&1 | grep ld | tail -1</TT> to see. <ITEM> <HTMLURL URL="http://www.xfree86.org" NAME="XFree86 Version">. Type <TT>xdpyinfo | grep 'release number'</TT> to see. <ITEM> The version of the Linux kernel you're running. Type <TT>uname -r</TT> to see. <ITEM> <HTMLURL URL="http://developer.java.sun.com/developer/bugParade/bugs/" NAME="JDC BugID"> if you've found one. <ITEM> A URL where with some related Java code or binary data. <ITEM> Your assessment of the problem's priority. </ENUM> <SECT1> Are There Any Debugging Techniques I Can Try Myself? <P> Try running the JDK java, appletviewer, and javac wrapper scripts like this: <P> <CODE> $ sh -x $JAVA_HOME/bin/java -verbose -verbosegc -cs -verify ... </CODE> or this: <CODE> $ strace -f -s 256 $JAVA_HOME/bin/java ... </CODE> That last command will be <EM>very</EM> noisy, but you may be surprised what you learn from reading it. <SECT1> That Didn't Help. What Else Can I Do? <LABEL ID="trouble-script"> <P> We've created a troubleshooting information collection script that you can download from <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/java-linux-info.sh" NAME="http://www.place.org/˜stevemw/java/FAQ/java-linux-info.sh"> and follow the instructions at the top of it. Read the output carefully; it's full of hints that can help you solve the problem on your own. <SECT>Detail on Running The Blackdown JDK <P> This section discusses various aspects of running the JDK in detail. <LABEL ID="dist-specific"> <SECT1> Last Update <P> <VERB> $Id: 05-detail.sgml,v 1.3 1998/11/13 04:20:04 stevemw Exp $ </VERB> <SECT1> I'm on <your favorite Linux distribution here> What Do I Need? <SECT2> Missing libXp <P> From the README file: <QUOTE> The JDK now depends on having the X printing library, libXp installed with the rest of your X files. This is part of the most recent X11 distributions, so you'll need to upgrade (or, if you are daring, you can just extract the libXp.so* file from the upgrade package for your Linux distribution and install it by hand w/o upgrading everything else, although this is unlikely to work if your X libraries are substantially out of date). </QUOTE> <SECT2> The glibc versus libc5 Problem <P> The latest versions of the Blackdown JDK have their own built-in loader (libdl.so) and libc.so, which will hopefully make them more robust in most cases. Older versions of the JDK 1.1.5 (especially) are much more sensitive. Take a look in <TT>$JAVA_HOME/i386/green_threads/</TT> to see these files. (You may remove them if you feel they are a source of trouble to you.) Karl Asha maintains a list of JDK-related library issues at: <HTMLURL URL="http://www.blackdown.org/java-linux/docs/libraries.html" NAME="http://www.blackdown.org/java-linux/docs/libraries.html">. In short, you need <TT>glibc-2.0.7</TT> and <TT>glibc-devel-2.0.7</TT> or higher on a glibc-based system such as RedHat 5.0 or Debian 2.0. There are RPMs for these on RedHat Intel systems at <HTMLURL URL="ftp://ftp.redhat.com/pub/redhat/current/updates/i386" NAME="ftp://ftp.redhat.com/pub/redhat/current/updates/i386">. <P> For a <TT>libc5</TT> system, you need <TT>libc.so.5.44</TT> or greater, along with a recent <TT>libdl.so</TT>. You can find these at <HTMLURL URL="ftp://tsx-11.mit.edu/pub/linux/packages/GCC" NAME="ftp://tsx-11.mit.edu/pub/linux/packages/GCC">. <P> For an in-depth discussion of this issue, see section <REF ID="glibc-libc5" NAME="What is glibc, and Why Does it Matter?">. <SECT2> RedHat Installation Tips <P> Download the <TT>glibc</TT> and <TT>ld</TT> updates described under <HTMLURL URL="http://www.redhat.com/support/docs/errata.html" NAME="http://www.redhat.com/support/docs/errata.html">. <SECT3> RedHat RPM Availability <P> According to <HTMLURL URL="mailto:sorin@tuiasi.ro" NAME="Sorin Lingureanu <sorin@tuiasi.ro>">, JDK RPMs are to be found in <HTMLURL URL="ftp://ftp.redhat.com/pub/contrib" NAME="ftp://ftp.redhat.com/pub/contrib">. Levente Farkas has more information about running the Blackdown JDK on RedHat here: <HTMLURL URL="http://anna.inf.u-szeged.hu/java/java-rpm.html" NAME="http://anna.inf.u-szeged.hu/java/java-rpm.html">. <SECT3> RedHat/RPM Environment Variable Issues <P> In addition to the general problems described in section <REF ID="env-problems" NAME="Environment Variables">, make sure that you don't have conflicting <TT>JDK_HOME</TT>, <TT>JAVA_HOME</TT>, and <TT>CLASSPATH</TT> environment variables set from scripts sourced from <TT>/etc/profile.d/</TT> at login. This can especially be a problem when trying multiple versions of the JDK in succession. <SECT2> Debian <P> <HTMLURL URL="mailto:preavis@partnersoft.com" NAME="Paul Reavis <preavis@partnersoft.com>"> has an excellent page with details at <HTMLURL URL="http://www.partnersoft.com/˜reavis/java/Debian-JDK.html" NAME="http://www.partnersoft.com/˜reavis/java/Debian-JDK.html">. <SECT2> Slackware <P> In JDK versions 1.1.5 through 1.1.6v2 we've seen a problem with <TT>libc.so</TT> and <TT>libdl.so</TT> shipped with the JDK in <TT>$JAVA_HOME/lib/i386/green_threads</TT> conflicting with the system. Try removing these and then running Java. <P> Please help by posting your experiences with the Blackdown JDK on Slackware. <SECT2> Other Linux Distributions <P> Check with <HTMLURL URL="http://nr.conexware.com/˜zorzella/wine/FAQ2.htm" NAME="http://nr.conexware.com/˜zorzella/wine/FAQ2.htm"> to see if Luiz Otávio Lautenschläger Zorzella has additional information that applies to your platform. <P> You're welcome to contribute what you know to the FAQ. <SECT1> Is There Anything Different About Native Interfaces on Linux? <P> Not really. The compilation flags may need to be different from what Javasoft recommends in the Solaris-oriented documentation. <P> <HTMLURL URL="mailto:kreilede@issan.cs.uni-dortmund.de" NAME="Juergen Kreileder <kreilede@issan.cs.uni-dortmund.de>"> points out that with the new Native Threads package, you should add the <TT>-D_REENTRANT</TT> flag to your other options. Pointers to more information about the native threads pack is available in section <REF ID="native-threads" NAME="Is There a Native Threads Port of the Blackdown JDK?">. <P> Keep in mind that there has been a known problem with all green threads implementations and the JVM Invocation API, discussed in section <REF ID="jvm-green-invoke" NAME="Is There a Problem with Green Threads and the JVM Invocation API?">. <P> There have been reports of problems with C++ <EM>IOStreams</EM> using <TT>libstdc++-2.7.x</TT>. Note that <TT>g++-2.8.1</TT> and <TT>libstdc++-2.8.1</TT> have been tested, and seem to work fine for several users on RedHat 5.0. <SECT2> Compiling Library Code for JNI <P> <HTMLURL URL="mailto:roskos@bellatlantic.net" NAME="Ed Roskos <roskos@bellatlantic.net>"> gives us these instructions for C JNI: <QUOTE> I've written a few shared libraries for use under both Linux and Solaris, and since a few people are curious about this, here goes: <ENUM> <ITEM> Make sure you have run javah. Plenty of documentation on this exists. <ITEM> You must first compile your C source files to object files, which end in ".o". Example: <NEWLINE> <TT> gcc -fPIC -c -I<java-header-path> file1.c -o file1.o</TT> <NEWLINE> You must replace <TT><java-header-path></TT> with the path to the include files for java-linux. <ITEM> Create your library. This is not the same as creating an executable. Under Linux, use: <NEWLINE> <TT>ld -shared file1.o -o libMyLib.so</TT> <NEWLINE> If you have more than <TT>file1.o</TT>, just list them after <TT>file1.o</TT>. </ENUM> <P> You can then, from Java, load your library as <TT>System.loadLibrary("MyLib");</TT> <P> Hope this helps. <P> Ed Roskos roskos@bellatlantic.net </QUOTE> <SECT1> What about Green Threads and Console Priority? <P> According to <HTMLURL URL="mailto:Michael.Sinz@sinz.org" NAME="Michael.Sinz@sinz.org">, <QUOTE> As of JDK 1.1.6 v5, Kevin fixed the STDIO (System.in/System.out/System.err) problem. In JDK 1.1.7 V1 it was fixed even better for the poll() changes. </QUOTE> Previous discussion of this problem is included for people on older JVMs. <P> <HTMLURL URL="mailto:hplus@zilker.net" NAME="Jon Wätte <hplus@zilker.net>">, has a brief synopsis of green threads at <HTMLURL URL="http://www.zilker.net/˜hplus/jvm.html" NAME="http://www.zilker.net/˜hplus/jvm.html">. He states: <QUOTE> Sun's Java VM as running on Solaris [without the native threads package] used a user-level thread package named Green Threads. This is strictly a collaborative threading package; the JVM is one system process and only executes one Java code stream at a time. <P> This is convenient for implementors, because special operations that required nobody else to touch sensitive data are intrinsically protected. As long as you don't relinquish the CPU (and block signals) you're in no danger. <P> If you do a [System.in.readLine()], the JVM will sit in the blocking input call until input is available; nothing else will happen in your program. </QUOTE> <HTMLURL URL="mailto:bablokb@lrz.uni-muenchen.de" NAME="Bernhard Bablok <bablokb@lrz.uni-muenchen.de>"> has this suggestion: <QUOTE> [The] <TT>System.in.readLine()</TT> [method] won't block other threads, if their priorities differ. My experience is, it doesn't matter which threads have a higher/lower priority. Priority shouldn't be much lower than <TT>Thread.NORM_PRIORITY</TT> (much lower means two lower on Linux). </QUOTE> <SECT1> Is There a Problem with Green Threads and the JVM Invocation API? <LABEL ID="jvm-green-invoke"> <P> Yes, there's a known problem with Javasoft's user-level threads package (called green threads) and the Invocation API because of the way it wraps system calls. See section <REF ID="green-threads" NAME="What are Green Threads?"> for more information on green threads. Note that there is native thread support in the current JDK. See section <REF ID="native-threads" NAME="Is There a Native Threads Port of the Blackdown JDK?">. <SECT2> Green Threads and Wrapped System Services <P> Uncle George, Juergen Kreileder, and Bernd Kreimeier have encountered this problem, and through their discussion of it we have this list of references to consult for more information: <ITEMIZE> <ITEM> JDC Bug Parade bug ID at <HTMLURL URL="http://developer.java.sun.com/developer/bugParade/bugs/4040743.html" NAME="http://developer.java.sun.com/developer/bugParade/bugs/4040743.html"> <ITEM> <EM>The Java Tutorial</EM> under "Invoking the Java Virtual Machine" at <HTMLURL URL="http://java.sun.com/docs/books/tutorial/native1.1/implementing/" NAME="http://java.sun.com/docs/books/tutorial/native1.1/implementing/"> <ITEM> Rob Gordon's excellent <EM>Essential JNI</EM> published in 1998 by <HTMLURL URL="http://www.phptr.com/" NAME="Prentice Hall PTR">, ISBN 0-13-679895-0 </ITEMIZE> Gordon suggests in <EM>Essential JNI</EM> on page 260 that: <QUOTE> When building a Java-enabled application on Solaris and linking against the green threads version of libjava.so, you must defer system calls until after the call to JNI_CreateJavaVM. This is because the user-level threads package in libjava.so (green threads) defines its own system calls . . . </QUOTE> And the <HTMLURL URL="http://java.sun.com/docs/books/tutorial/native1.1/implementing/invo.html" NAME="JDK 1.1 Tutorial"> suggests that, "The first step toward getting this to work is always to link libjava.so into the executable *first*, even before libc.so . . ." <!-- Sun Jun 21 03:09:57 PDT 1998 --> <SECT2> Hacking Around the System Service Wrappers <P> On June 21, 1998 Uncle George posted these paraphrased comments: <QUOTE> Actually, library calls are overridden, not system-calls. If you are savvy enough, you can call the system service yourself, and forget the library interface (i.e. instead of using select, try <TT>__select</TT>). But in doing so, the green threading . . . can be compromised, i.e. other threads won't be runnable until that service completes. <P> The <BF>malloc()/free()</BF> bogus pointer messages are problems in trying to free a pointer twice, of which some "MALLOC" packages get terminally upset with . . . </QUOTE> <P> You may also be interested in the discussion of native threads in section <REF ID="native-threads" NAME="Is There a Native Threads Port of the Blackdown JDK?">. <!-- Tue May 26 02:20:03 PDT 1998 --> <SECT1> Can I Display and Input Kanji with the Blackdown JDK? <P> In addition to the information found here, you will certainly appreciate Dan Kegel's page, <EM>Fonts and Internationalization in Java</EM> found at <HTMLURL URL="http://www.alumni.caltech.edu/~dank/javafont.htm" NAME="http://www.alumni.caltech.edu/~dank/javafont.htm">. You are encouraged to visit Javasoft's 1.1 discussion of this topic at <HTMLURL URL="http://www.javasoft.com/products/jdk/1.1/docs/guide/intl/fontprop.html" NAME="http://www.javasoft.com/products/jdk/1.1/docs/guide/intl/fontprop.html">, as well. <P> Please be aware that these FAQ entries are extremely sketchy at the moment. If you have additional information about making CJK (Chinese, Japanese, and Korean) code work well with Java on Linux, please tell the FAQ maintainer. <SECT2> Library Issues <P> The following entries also relate more to situations that arise when you must settle on one set of libraries or the other, and you end up without being able to run some application or another because of unresolved symbols. Keep in mind that with their own builtin loader and libc, recent versions of the JDK shouldn't cause you to change your libraries at all. <SECT3> Libc5 Systems <LABEL ID="kanji-locale-hacks"> <P> <HTMLURL URL="mailto:nmatsumu@can.bekkoame.ne.jp" NAME="Nozomi Matsumura <nmatsumu@can.bekkoame.ne.jp>"> has a suggestion that at least applied to earlier, <TT>libc5</TT> versions of the JDK, and may still work. It involves making use of multi-byte character support provided in builds of <TT>libX11.so</TT> with the <BF>Xsetlocale(3)</BF> call. <P> Matsumura-san points us at this fix provided by <HTMLURL URL="mailto:hisama2@asahi.email.ne.jp" NAME="Hiroshi Hisamatsu <hisama2@asahi.email.ne.jp>">, which is a small, shared library (<TT>liblocale.so</TT>) to explicitly specify the Kanji locale. It is available from <HTMLURL URL="http://www.asahi-net.or.jp/˜nf6h-hsmt/jdk1.1.1-locale.tar.gz" NAME="http://www.asahi-net.or.jp/˜nf6h-hsmt/jdk1.1.1-locale.tar.gz">. <P> More detail on this is available in Japanese at <HTMLURL URL="http://www.asahi-net.or.jp/˜nf6h-hsmt/java.html" NAME="http://www.asahi-net.or.jp/˜nf6h-hsmt/java.html">. The fix also involves adding the following lines to your <TT>.java_wrapper</TT> file in <TT>$JAVA_HOME/bin</TT>: <CODE> LD_PRELOAD="$JAVA_HOME/lib/${ARCH}/${THREADS_TYPE}/liblocale.so" export LD_PRELOAD </CODE> Matsumura-san also mentions changing the locale specified by your environment variable <TT>LANG</TT> to <TT>ja</TT>, and says that <TT>ja_JP.{EUC,ujis}</TT> did not work. <!-- Sun May 31 14:39:14 PDT 1998 --> <SECT3> Libc6 (glibc) Systems <P> In addition to the properties hacks mentioned above (see section <REF ID="kanji-locale-hacks" NAME="Libc5 Systems">), the inverse of what <TT>liblocale.so</TT> does is probably possible on glibc-based systems, if there's a problem (with some other application) at all. You may be able to simulate <BF>Xsetlocale(3)</BF> by wrapping <BF>setlocale(3)</BF> with it. For example, libc5 versions of XFree86 (see <HTMLURL URL="http://www.xfree86.org" NAME="http://www.xfree86.org">) handle locale with the <BF>Xsetlocale(3)</BF> call, but that changes under glibc to plain <BF>setlocale(3)</BF>. See the <BF>setlocale(3)</BF> manual page for more information. <!-- Sun Jul 26 01:18:44 PDT 1998 --> <SECT2> Entering Two Byte Kanji with XIM <P> On July 14th, 1998, <HTMLURL URL="mailto:nmatsumu@can.bekkoame.ne.jp" NAME="Nozomi Matsumura <nmatsumu@can.bekkoame.ne.jp>"> also submitted this information acquired from <HTMLURL URL="mailto:hisama2@asahi.email.ne.jp" NAME="Minori Takagaki <lennen@st.rim.or.jp>">, who was able to input and display Kanji using TextComponent. <P> Takagaki was able to input directly using kinput2(XIM) or by cut&paste in Java applications and in appletviewer. <P> Takagaki's environment is: <ITEMIZE> <ITEM> Slackware-3.4 + PJE-0.1(*1) <ITEM> Kernel: 2.0.34 <ITEM> libc: 5.4.38 <ITEM> jdk1.1.6-v1-libc5 </ITEMIZE> Takagaki said to use Japanese characters, you need to setup as described here: <ENUM> <ITEM> Install Red Hat Motif 2.1 and X-TT(*2) <ITEM> Modify <TT>font.properties.ja</TT> (to use X-TT fonts) <ITEM> Get <TT>liblocale.so</TT> (see the discussion of this above in <REF ID="kanji-locale-hacks" NAME="Libc5 Systems">) <ITEM> modify <TT>.java_wrapper</TT> <CODE> export LD_PRELOAD=liblocale.so export LANG=ja export DYN_JAVA=1 # to use libXm.so.2 from RH Motif2.1 </CODE> <ITEM> If using appletviewer, modify <TT>$JAVA_HOME/bin/i686/green_threads/appletviewer</TT> to use the dynamically linked java binary. </ENUM> X-TT is free a X font server for using Japanese TrueType Fonts. See <HTMLURL URL="http://www.ryukyu.ad.jp/~shin/linux/x-tt/" NAME="http://www.ryukyu.ad.jp/~shin/linux/x-tt/">. <P> But some probelms occur: <ENUM> <ITEM> The <TT>getText()</TT> function is O.K. but <TT>setText()</TT> is <BF>not</BF>. <ITEM> Mouse drag selection is <BF>not</BF> well. Strings with Japanese characters using TextField/TextArea are <BF>not</BF> selected correctly. <ITEM> When a cursor moves in TextField, Japanese characters are often modified randomly. <ITEM> When Japanese characters are input in TextAreas, display timing is very strange. But <TT>getText()</TT> works correctly. Example: to input 'NIHONNGO abcdef' when keying 'ab', 'NI' shows; when keying 'cd', 'HONN' shows, etc. . . </ENUM> <SECT> Questions about Non-i386 Blackdown JDK Ports <LABEL ID="non-intel-ports"> <P> This section attempts to provide some additional information about non-Intel versions of the Blackdown JDK. At this time, Karl Asha has a more complete catalog of the different platforms available at <HTMLURL URL="http://www.blackdown.org/java-linux/ports.html" NAME="http://www.blackdown.org/java-linux/ports.html">. Help determining which JDK to download is available in section <REF ID="version-to-download" NAME="OK, Which Version of the JDK Should I Download?">. <SECT1> Last Update <P> <VERB> $Id: 06-non-i386.sgml,v 1.1 1998/11/13 02:50:16 stevemw Exp $ </VERB> <SECT1> What's the Status of the SPARC Port? <!-- Fri Jun 19 12:38:26 PDT 1998 --> <P> On June 16, 1998 <HTMLURL URL="mailto:johan@sesuadra.org" NAME="Johan Vos <johan@sesuadra.org>"> provided this summary of the current SPARC effort, which is based at <HTMLURL URL="http://sesuadra.org/˜jdk/" NAME="http://sesuadra.org/˜jdk/">: <QUOTE> Starting from JDK 1.1.5, the Intel and SPARC ports are based on the same code. The SPARC-specific issues are separated from the other linux-specific issues. Improvements and bug-fixes in the general source code can be implemented without having to re-implement the SPARC-specific code. As a consequence, most problems and updates on the Intel-JDK also occur on the SPARC-JDK. I try to synchronize as much as possible with Steve's ports -- although licensing problems caused the JDK 1.1.6v1 release for SPARC to be a few days after the Intel-release. <P> For the differences between static and dynamic linked versions -- of the Motif library --, the same remarks as for the Intel-release hold. <P> Up to now, there is no port for glibc-systems -- since I don't have a glibc-system. Most likely, this porting will be done in the near future. </QUOTE> Johan follows up on 11/09/1998 with this comment: <QUOTE> [The] JDK for sparclinux systems currently only exist for libc 5 systems. I am working on a port for glibc, but this will be a jdk 1.2 port. . . . </QUOTE> <SECT1> Is there an Alpha Port? <P> Yes. Please see <HTMLURL URL="http://www.blackdown.org/java-linux/ports.html" NAME="http://www.blackdown.org/java-linux/ports.html"> for more information. <SECT1> Is there a PowerPC Port? <P> Yes. Please see <HTMLURL URL="http://business.tyler.wm.edu/mklinux/" NAME="http://business.tyler.wm.edu/mklinux/"> for more information. <SECT> General Questions about Java <P> This section contains general questions about Java. Clearly, this FAQ can't address these sorts of questions and focus on the Blackdown JDK adequately. Look for a few good pointers to other documents here. <SECT1> Last Update <P> <VERB> $Id: 07-general.sgml,v 1.2 1998/11/13 04:20:04 stevemw Exp $ </VERB> <SECT1> Where Can I Learn More about Java? <!-- Thu May 28 05:04:49 PDT 1998 --> <P> Here are a number of excellent starting points. <ITEMIZE> <ITEM> Elliotte Rusty Harold's <HTMLURL URL="news:comp.lang.java" NAME="comp.lang.java"> FAQ: <HTMLURL URL="http://sunsite.unc.edu/javafaq/javafaq.html" NAME="http://sunsite.unc.edu/javafaq/javafaq.html"> <ITEM> The Java networking FAQ: <HTMLURL URL="http://www.io.com/˜maus/JavaNetworkingFAQ.html" NAME="http://www.io.com/˜maus/JavaNetworkingFAQ.html"> <ITEM> Peter van der Linden's Java Programmer's FAQ: <HTMLURL URL="http://www.best.com/˜pvdl/javafaq.html" NAME="http://www.best.com/˜pvdl/javafaq.html"> <ITEM> Javasoft's Developer Connection FAQ: <HTMLURL URL="http://developer.javasoft.com/developer/techDocs/faqs.html" NAME="http://developer.javasoft.com/developer/techDocs/faqs.html"> </ITEMIZE> <SECT>General Questions about Linux <P> This FAQ tries to focus on the Blackdown JDK, but we attempt to answer a few Linux-specific questions here. <SECT1> Last Update <P> <VERB> $Id: 08-linux.sgml,v 1.1 1998/11/13 02:50:16 stevemw Exp $ </VERB> <SECT1> Where Can I Find Linux FAQs, Mailing Lists, and Documentation? <P> Here's a list of good places to start: <P> <ITEMIZE> <ITEM> The Linuxdoc project: <HTMLURL URL="http://sunsite.unc.edu/LDP/" NAME="http://sunsite.unc.edu/LDP/">. <ITEM> The main Linux website: <HTMLURL URL="http://www.linux.org/" NAME="http://www.linux.org/">. <ITEM> Linux kernels and libraries: <HTMLURL URL="http://www.kernel.org/" NAME="http://www.kernel.org/">. </ITEMIZE> <!-- Sun May 24 16:05:36 PDT 1998 --> <SECT1> What is glibc, and Why Does it Matter? <LABEL ID="glibc-libc5"> <P> I'll explain what libc and glibc are in a bit, but first, let me say that the current Blackdown Linux JDK tries to avoid library incompatibilities by providing a dedicated dynamic loader and its own <TT>libc.so</TT>. And (I think) even before this change, the problem of "which of libc5 or glibc is needed" was theoretically only experienced on systems such as RedHat 5.0 and Debian 2.0 that had so rapidly moved to glibc. Other library conflicts are always bound to happen because of the variety of Linux versions and configurations there are. <P> The UNIX "libc" is the core set of functions to which most utility and application code links. You can see references to libc in the <BF>intro(3)</BF> manual page. For your information, functions described in section two (see <BF>intro(2)</BF>) of the manual are all inside the kernel, whereas section three describes those which may be standard, but are stored in separate libraries. To view these pages, make sure your core manual pages are installed, and type <TT>man 3 intro</TT>, for example. <P> In order to save disk space and memory, modern operating systems like Linux have taken to using "shared" libraries that don't move their contents into code which links to them during the build process. Although there is a <TT>/usr/lib/libc.a</TT>, most production code is linked to <TT>/usr/lib/libc.so</TT>, which is typically a link-editor script for selecting the actual libc.so (shared object) archive. <P> In short, lots of programs on your system share code out of one or more files as they execute. To see what shared code an executable needs, there is an optional Linux utility named <BF>ldd(1)</BF>. If it's on your system, you can type <TT>ldd PROGRAM</TT> to see its shared libraries. <P> Here's an example: <CODE> $ ldd /bin/ls libc.so.6 => /lib/libc.so.6 (0x40003000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000) </CODE> The older (and still most common) Linux libc was known as "libc5." The GNU/Linux development community sought to improve on it by adding thread-safety where possible, 64-bit support, better POSIX and XPG4.2 compliance, superior organization of the library sources, and multi-byte character locale support. These and other changes will bring even more robustness and quality to the Linux development environment. Although the changes are inconvenient to us sometimes, the end result should be worth it. <P> The new library is now called "glibc" because it's a library common across Linux and HURD, and enjoys a broad base of GNU developer contributions. (I don't know how much of the earlier Linux libc software was derived from GNU libc, which has been around for quite a while on its own, I think.) <P> For more information on GNU libc, see <HTMLURL URL="http://www.imaxx.net/˜thrytis/glibc/" NAME="http://www.imaxx.net/˜thrytis/glibc/">. Since C is central to the history and development of UNIX and Linux, you might enjoy the links found on <HTMLURL URL="http://www.dundee.ac.uk/˜bmsimpso/work/C-Programming/" NAME="http://www.dundee.ac.uk/˜bmsimpso/work/C-Programming/"> as well. <SECT> Compiling the Blackdown JDK from Source <P> Here are some answers to questions about the JDK source code. <LABEL ID="jdk-building"> <SECT1> Last Update <P> <VERB> $Id: 09-source.sgml,v 1.1 1998/11/13 02:50:16 stevemw Exp $ </VERB> <SECT1> Can I Build Java Myself? <P> Building the JDK on Linux with patches supplied by Steve Byrne is fairly straightforward. See <HTMLURL URL="http://www.blackdown.org/˜sbb" NAME="http://www.blackdown.org/˜sbb"> for the diffs and some additional details. <P> I encourage you to read <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/README.linux.src.txt" NAME="README.linux.src"> from the patched source distribution if you plan to undertake this project. You will need to sign a license agreement with Javasoft in order to download the sources. <P> See section <REF ID="src-agreement" NAME="Could You Give Me a Pointer to Sun's Licensing Agreement?"> below for details. <SECT1> Could You Give Me a Pointer to Sun's Licensing Agreement? <LABEL ID="src-agreement"> <P> In order to obtain the JDK sources, first you must read, sign, and FAX in an agreement with Sun. The agreement can be found at <HTMLURL URL="http://www.javasoft.com/nav/business/source_form.html" NAME="http://www.javasoft.com/nav/business/source_form.html">. <SECT1> How do I Build the JDK Now that I Have the Source? <P> Please read the <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/README.linux.src.txt" NAME="http://www.place.org/˜stevemw/java/FAQ/README.linux.src"> file. <SECT1> What about Motif? Don't I Need That? <P> You can build the JDK against Lesstif, the <HTMLURL URL="http://www.hungry.com" NAME="Hungry Programmers'"> GNU copylefted implementation of the Motif API. For more information, visit their website at <HTMLURL URL="http://www.lesstif.org" NAME="http://www.lesstif.org">. Make sure you get the "current" distribution. They are very responsive to accurate bug and problem reports. <P> On the other hand, a number of Motif developer library vendors exist for Linux systems. I recommend you read the Motif <HTMLURL URL="news:comp.windows.x.motif" NAME="comp.windows.x.motif"> news group FAQ. You can find it here: <HTMLURL URL="http://www.rahul.net/kenton/faqs/mfaq_index.html" NAME="http://www.rahul.net/kenton/faqs/mfaq_index.html">. <SECT1> When I Build and Install, I Get Unsatisfied Link Errors at Runtime! <!-- Mon Jun 15 02:47:00 PDT 1998 --> <P> Make sure you're building all the targets Steve Byrne suggests in <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/README.linux.src.txt" NAME="http://www.place.org/˜stevemw/java/FAQ/README.linux.src">. Here's an example: <CODE> make DESTDIR="$ALT_JAVAHOME/jdk116v2b" RELEASE="MY-JDK1.1.6-V2B" \ appletviewer jre_only 2>&1 | tee MakeOut-V2B1-BUILD-01 </CODE> In this example, I have <TT>ALT_JAVAHOME</TT> set to the <TT>javasrc/build</TT>, just above the <TT>genunix/</TT> target directory. You should be able to set <TT>ALTMOTIF_DIR</TT> to where you've installed Lesstif. <P> Note: you ought to have <TT>ALT_BOOTDIR</TT> set to a running JDK 1.1, and I build with <TT>CLASSPATH</TT> and <TT>JAVA_HOME</TT> unset. <!-- Mon Jun 15 02:24:01 PDT 1998 --> <SECT1> Can I Try Builds of the Latest JDK Port in Development? <P> Please stay tuned to the mailing list for announcements. <SECT> About the People Behind the Blackdown JDK <P> This section answers questions about the people who've contributed to the Blackdown project. <SECT1> Last Update <P> <VERB> $Id: 10-people.sgml,v 1.1 1998/11/13 02:50:16 stevemw Exp $ </VERB> <SECT1> Who Ported the Blackdown JDK? <LABEL ID="jdk-porters"> <P> <HTMLURL URL="mailto:chapman@wilbursoft.com" NAME="Randy Chapman <chapman@wilbursoft.com>"> did the original port of the Solaris JDK 1.0 to Linux on the i386. <P> Steve Byrne has done much of the work on the Intel port of 1.1. <P> Quoting Steve Byrne from <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/README.linux.txt" NAME="http://www.place.org/˜stevemw/java/FAQ/README.linux"> <QUOTE> Special thanks to Johan Vos (Sparc Linux port), Chris Seawood (GLIBC), Karl Asha (who gave us blackdown, thanks Karl!) Kevin Buettner, Scott Hutinger, Kevin Hendricks, Brian Keller, Philippe Laliberte and the rest of the PowerPC porting team -- these guys really fixed a *lot* of generic JDK bugs -- the 1.1.5 port is *much* better as a result of their hard work. Dan Powell and Rich Cannings have been very gracious to take over the administrative duties and to provide a site (and domain name) dedicated to java-linux -- thanks! </QUOTE> And again: <QUOTE> Neal Sanche fixed the thread creep bug. Thanks, Neal! </QUOTE> Please pass on historical information to the FAQ maintainer. <SECT1> Who is Steve Byrne? <LABEL ID="sbb-who"> <P> Steve has some auto-biographical information on his web page at <HTMLURL URL="http://java.sun.com/people/sbb/index.html" NAME="http://java.sun.com/people/sbb/index.html">. <SECT1> Who is Karl Asha? <LABEL ID="karl-who"> <P> Karl has this response: <QUOTE> Not too much to say...some time back in 1995 I wanted so much to have java on a linux box so I started harassing people I knew to work on it. I put together the web site, the mailing lists, etc, helped out a little here and there with the port, and things just bloomed :) </QUOTE> <SECT>Information on the Java-Linux FAQ <P> This section gives some background information about the FAQ itself. <SECT1> Last Update <P> <VERB> $Id: 11-faq.sgml,v 1.1 1998/11/13 02:49:25 stevemw Exp $ </VERB> <SECT1> Who Maintains the FAQ? <LABEL ID="faq-maintainer"> <P> Stephen Wynne is the current FAQ maintainer. However, answers to questions found in this document are from a variety of participants on <HTMLURL URL="mailto:java-linux@java.blackdown.org" NAME="java-linux@java.blackdown.org">. If you have <EM>any</EM> comments, clarifications, or corrections, please send them to <HTMLURL URL="mailto:stevemw@place.org" NAME="Stephen Wynne <stevemw@place.org>">. If you have something to add, please send E-mail to the list itself. <SECT1> Where Can I Get a Copy of the FAQ? <P> Most-recent copies of this FAQ can currently be found at <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/FAQ-java-linux.html" NAME="http://www.place.org/˜stevemw/java/FAQ/FAQ-java-linux.html">. <P> Here's the text version of this document: <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/FAQ-java-linux.txt" NAME="http://www.place.org/˜stevemw/java/FAQ/FAQ-java-linux.txt">. The PostScript "letter" version: <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/FAQ-java-linux.ps" NAME="http://www.place.org/˜stevemw/java/FAQ/FAQ-java-linux.ps">. The PostScript "A4" version: <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/FAQ-java-linux-a4.ps" NAME="http://www.place.org/˜stevemw/java/FAQ/FAQ-java-linux-a4.ps">. Full source for the original at <HTMLURL URL="http://www.place.org/˜stevemw/java/FAQ/" NAME="http://www.place.org/˜stevemw/java/FAQ/">. <P> The FAQ is regularly mirrored to <HTMLURL URL="http://www.blackdown.org/java-linux/docs/faq/FAQ-java-linux.html" NAME="http://www.blackdown.org/java-linux/docs/faq/FAQ-java-linux.html">. <SECT1> Please Help the FAQ Maintainer! <LABEL ID="faq-helpers"> <P> The FAQ maintainer is looking for the following information: <ITEMIZE> <ITEM> Any CJK setup tips and suggestions you may have. </ITEMIZE> <SECT1> Are there Any Plans for Automating the FAQ? <P> At this point, the FAQ maintainer has considered FAQ-o-matic (found at <HTMLURL URL="http://www.dartmouth.edu/cgi-bin/cgiwrap/jonh/faq.pl" NAME="http://www.dartmouth.edu/cgi-bin/cgiwrap/jonh/faq.pl">) and Wiki web (found at <HTMLURL URL="http://c2.com/cgi/wiki" NAME="http://c2.com/cgi/wiki">). Your comments and suggestions would be appreciated. <SECT1> Caveat Emptor <P> This document may contain technical information that is incorrect, out-dated, and may <EM>unintentionally</EM> misrepresent the opinions of <HTMLURL URL="mailto:java-linux@java.blackdown.org" NAME="java-linux@java.blackdown.org"> participants. Neither the FAQ maintainer nor the members of the mailing list make any warranty with respect to its usefulness or safety. <SECT1> Terms of Use <P> This document is copyright 1998 by Stephen M. Wynne. You may use, disseminate, and reproduce it freely, provided you: <ITEMIZE> <ITEM> Do not omit or alter this copyright notice. <ITEM> Do not omit or alter or omit the version number and date. <ITEM> Do not omit or alter the document's pointer to the current WWW version. <ITEM> Clearly mark any condensed, altered or versions as such. </ITEMIZE> These restrictions are intended to protect potential readers from stale versions. <SECT1> Acknowledgements <P> This FAQ's content and structure was inspired by several documents produced by Eric S. Raymond. Eric also maintained an early HOWTO regarding Java on Linux. It's archived at <HTMLURL URL="http://sagan.earthspace.net/˜esr/faqs/java.html" NAME="http://sagan.earthspace.net/˜esr/faqs/java.html">. <P> The FAQ was produced directly from SGML with <HTMLURL URL="http://www.sgmltools.org" NAME="the SGML tools package"> v0.99.0, using the <TT>LINUXDOC.DTD</TT>. </ARTICLE>