home *** CD-ROM | disk | FTP | other *** search
/ Java 1996 August / Java - Summer 1996.iso / Linux / HOWTO / java-linux-HOWTO.2.0.info < prev    next >
Encoding:
GNU Info File  |  1996-01-22  |  39.2 KB  |  956 lines

  1. This is Info file java-linux-HOWTO.2.0.info, produced by Makeinfo-1.63
  2. from the input file /tmp/sgml2info4580tmp2.
  3.  
  4.    \input texinfo
  5.  
  6. 
  7. File: java-linux-HOWTO.2.0.info,  Node: Top,  Next: Introduction,  Up: (dir)
  8.  
  9. Java on Linux HOWTO
  10. *******************
  11.  
  12.      maintained by Eric S. Raymond,
  13.      v.2.0, 20 Jan 1996
  14.  
  15.    This document describes how to get started with Java and HotJava
  16. under Linux, as either a user or a programmer.
  17.  
  18. * Menu:
  19.  
  20. * Introduction::
  21. * General Questions About Java and HotJava::
  22. * Java as Freely Redistributable Software::
  23. * Java On Linux Questions::
  24. * Building the Linux Java port on stock Linuxes::
  25. * Viewing Applets::
  26. * Notes on Known Problems::
  27. * Related Resources::
  28. * To Be Added--::
  29. * Acknowledgements::
  30.  
  31. 
  32. File: java-linux-HOWTO.2.0.info,  Node: Introduction,  Next: General Questions About Java and HotJava,  Prev: Top,  Up: Top
  33.  
  34. Introduction
  35. ************
  36.  
  37.    This document is a Linux-centric introduction to the world of Java
  38. and HotJava.  These technologies are rapidly evolving, and we welcome
  39. contributions from anywhere.
  40.  
  41.    Places in this document that are in serious need of checking or
  42. filling out are bracketed with *** ***.  Also see the *Note To Be
  43. Added--::  section below.  Please help us improve this HOWTO.  Send
  44. updates and change requests to .
  45.  
  46. 
  47. File: java-linux-HOWTO.2.0.info,  Node: General Questions About Java and HotJava,  Next: Java as Freely Redistributable Software,  Prev: Introduction,  Up: Top
  48.  
  49. General Questions About Java and HotJava
  50. ****************************************
  51.  
  52.    This section is a general (non-Linux-specific) introduction to Java
  53. and HotJava.
  54.  
  55. * Menu:
  56.  
  57. * What are are Java and HotJava and why are they interesting?::
  58. * Where do Java and HotJava come from? Who can use them?::
  59. * How mature is Java?::
  60. * Where can I find documentation on Java and HotJava?::
  61. * Yes but where can I find paper documentation?::
  62. * Where can I find on-line collections of Java code?::
  63.  
  64. 
  65. File: java-linux-HOWTO.2.0.info,  Node: What are are Java and HotJava and why are they interesting?,  Next: Where do Java and HotJava come from? Who can use them?,  Up: General Questions About Java and HotJava
  66.  
  67. What are are Java and HotJava and why are they interesting?
  68. ===========================================================
  69.  
  70.    Java is a network-aware language superficially resembling C++, but
  71. much smaller and more compact and cleanly designed.  It's an
  72. unlimited-extent language with garbage collection like Lisp, but with
  73. static type checking (it's been aptly described as "Smalltalk with sane
  74. syntax").  It includes lightweight processes (threads) as a native
  75. facility and has powerful network-security features.  So far, its major
  76. application is the HotJava browser, but it holds considerable promise
  77. as a general-purpose application language.
  78.  
  79.    HotJava is a WWW browser written in Java.  Its major advance over
  80. other browsers is that it knows about a new HTML construct called an
  81. APPLET, which is some Java class that executes on the client machine.
  82. Thus, WWW documents written with Java in mind can have "live" code
  83. objects embedded in them, as opposed to just data.
  84.  
  85.    The ability to safely pass around code objects probably represents
  86. the most significant advance in WWW technology since the first release
  87. of Mosaic.  At minimum, it delivers an extensible Web browser that
  88. won't need perpetual upgrading to handle new image formats and tag
  89. types.
  90.  
  91. 
  92. File: java-linux-HOWTO.2.0.info,  Node: Where do Java and HotJava come from? Who can use them?,  Next: How mature is Java?,  Prev: What are are Java and HotJava and why are they interesting?,  Up: General Questions About Java and HotJava
  93.  
  94. Where do Java and HotJava come from? Who can use them?
  95. ======================================================
  96.  
  97.    Java and HotJava were developed at Sun Microsystems by a team headed
  98. by James Gosling (well known as the designer of Gosling Emacs and NeWS).
  99.  
  100.    The last time Sun tried to set a major technical standard was NeWS,
  101. its Network Window System.  Though NeWS was pretty universally conceded
  102. to be technically superior to X, X won because its sources were freely
  103. redistributable.  Sun learned from this mistake, and has made
  104. Java/HotJava much more generally available; the sources can be
  105. downloaded under a fairly relaxed license (see *Note Java as Freely
  106. Redistributable Software:: ).  Sun is encouraging ports to non-Sun
  107. environments.
  108.  
  109.    Netscape now interprets Java.  Microsoft licensed the technology in
  110. early December 1995.  So it appears that Java support will probably
  111. become universal in 1996.
  112.  
  113.    Java used to be called Oak.  HotJava was once known as WebRunner.
  114.  
  115. 
  116. File: java-linux-HOWTO.2.0.info,  Node: How mature is Java?,  Next: Where can I find documentation on Java and HotJava?,  Prev: Where do Java and HotJava come from? Who can use them?,  Up: General Questions About Java and HotJava
  117.  
  118. How mature is Java?
  119. ===================
  120.  
  121.    On December 12 1995 Sun released the `Beta 2' version of Java.  The
  122. Java environment API defining its access to the host OS and windowing
  123. system has allegedly been semi-frozen - it may be extended, but won't
  124. be incompatibly changed.
  125.  
  126.    The 1.0 version of this FAQ is being issued along with the beta 1.0
  127. Java Developer's Kit (JDK) for Linux, ported by Randy Chapman.
  128.  
  129.    Significant holes are known to exist in the Java security
  130. implementation.  It is not yet a good idea to use Java for sensitive
  131. applications.  These problems are expected to be fixed in the production
  132. (post-beta) releases.
  133.  
  134. 
  135. File: java-linux-HOWTO.2.0.info,  Node: Where can I find documentation on Java and HotJava?,  Next: Yes but where can I find paper documentation?,  Prev: How mature is Java?,  Up: General Questions About Java and HotJava
  136.  
  137. Where can I find documentation on Java and HotJava?
  138. ===================================================
  139.  
  140.    Sun maintains an extensive HTML web of Java and HotJava-related
  141. documents at .  These documents are mirrored at  and elsewhere; see
  142. Sun's list of mirror sites.
  143.  
  144. 
  145. File: java-linux-HOWTO.2.0.info,  Node: Yes but where can I find paper documentation?,  Next: Where can I find on-line collections of Java code?,  Prev: Where can I find documentation on Java and HotJava?,  Up: General Questions About Java and HotJava
  146.  
  147. Yes but where can I find paper documentation?
  148. =============================================
  149.  
  150.    SunSoft Press's official series of Java books is in the production
  151. pipeline at Addison-Wesley.  Some details about these can be found in
  152. the .
  153.  
  154.    Several Java early-adopters have recommended "Hooked on Java" by the
  155. members of the Java team.  "Well written, though I'd appreciate
  156. something less basic" was one comment.
  157.  
  158.    O'Reilly Associates is working on its own series of Java books in
  159. cooperation with Sun.  These will include (at least) a "Nutshell Guide
  160. To Java", a language reference, a class library reference, and a book
  161. on the underlying byte-code virtual machine.  (Full-disclosure
  162. statement: Your HOWTO editor has been invited by O'Reilly Associates to
  163. serve as primary technical reviewer for this series, and is being paid
  164. for that work.)
  165.  
  166.    SAMS has a book called "Learning Java in 21 Days".  No revieww yet.
  167.  
  168.    One of our contributors, browsing his local Bookstop/Barnes &
  169. Noble/Borders, came up with 3 books already out:
  170.    * One called 'Java in 60 minutes' that looked like a pretty strict
  171.      syntactic description (about $20).
  172.  
  173.    * One from SamsNet called just `Java' (about $20).
  174.  
  175.    * One by Tim Ritchey called `Java!' that includes a CD-ROM (about
  176.      $35).
  177.  
  178.    Our informant continues: "I bought the 3rd one (by Tim Ritchey).
  179. Paper leadtimes being what they are, the CD-ROM only has alpha stuff,
  180. though it mentions that the beta version might be out by the time you
  181. read it and suggests java.sun.com as a place to get more recent
  182. information.  Other than that, it's pretty good, even to pointing out
  183. that `well, it's pointless for me to spam you with pages and pages of
  184. API descriptions because 1) it would quadruple the size of the book and
  185. 20 they're still ch anging and 2) you can get that info online at
  186. ...etc'"
  187.  
  188.    Dave Dittrich writes: I'd say that "Java in 60 minutes" may take you
  189. 60 minutes to read, but won't teach you how to program in Java in 60
  190. minutes (surprise, surprise!)  It looks to me like "Java in 60 minutes"
  191. is one of the many attempts be first to market with a book on a hot
  192. topic.  It didn't seem to include much more than you can find right now
  193. on the Web, including lots of text that looks like it was lifted
  194. straight out of the Java Language Specification
  195. (http://java.sun.com/JDK-beta2/psfiles/javaspec.ps).
  196.  
  197.    Dave continues: Same thing with "Java!", only the latter goes into
  198. much more detail on object oriented programming concepts, etc.  Someone
  199. pointed me to another text book that is equally as good at covering
  200. data/method abstraction and other object oriented programming concepts,
  201. which is "Structure and Interpretation of Computer Programs" by
  202. Abelson, Sussman and Sussman (MIT Press).
  203.  
  204.    Final caveat: at this point (January 1996), it is probly a good idea
  205. to stay away from the Ritchey book or anything else based on the alpha
  206. API.  The beta API is substantially different, and the
  207. soon-to-be-released Java 1.0 will have its own differences.
  208.  
  209. 
  210. File: java-linux-HOWTO.2.0.info,  Node: Where can I find on-line collections of Java code?,  Prev: Yes but where can I find paper documentation?,  Up: General Questions About Java and HotJava
  211.  
  212. Where can I find on-line collections of Java code?
  213. ==================================================
  214.  
  215.    WWW archives of applets are available at the following locations:
  216.    *   *   *   *  Most of the applets on these pages come with source code, and
  217. programmers are invited to use them.
  218.  
  219.    Pointers to others may be available in the .
  220.  
  221. 
  222. File: java-linux-HOWTO.2.0.info,  Node: Java as Freely Redistributable Software,  Next: Java On Linux Questions,  Prev: General Questions About Java and HotJava,  Up: Top
  223.  
  224. Java as Freely Redistributable Software
  225. ***************************************
  226.  
  227.    Many Linux programmers are attached to producing freely
  228. redistributable software (FRS), and try to avoid committing a lot of
  229. time to tools for which sources are not generally available.  In this
  230. section, we discuss Sun's and Java's relationship with the FRS world.
  231.  
  232.    (Warning: I am not a lawyer.  I am neither employed by, nor an agent
  233. of, nor a stockholder in, Sun Microsystems.  This section is based on my
  234. interpretation of the current copyright law and the Sun licensing
  235. language.  Treat this as an introduction; the Sun licensing page,  is
  236. definitive. If you are in serious doubt about what it means, consult an
  237. attorney.)
  238.  
  239. * Menu:
  240.  
  241. * Are Java programs and applets freely redistributable?::
  242. * What can I do with Java implementation binaries?::
  243. * Which parts of the Java sources are freely redistributable?::
  244. * What is Sun's attitude towards FRS Java implementations and tools?::
  245. * Is anyone cloning Java in freely redistributable source?::
  246. * Are there any FRS Java Tools?::
  247.  
  248. 
  249. File: java-linux-HOWTO.2.0.info,  Node: Are Java programs and applets freely redistributable?,  Next: What can I do with Java implementation binaries?,  Up: Java as Freely Redistributable Software
  250.  
  251. Are Java programs and applets freely redistributable?
  252. =====================================================
  253.  
  254.    They are if you write them and choose to make them FRS through some
  255. mechanism (such as the GPL, or a BSD-style license, or declaring them
  256. public domain).
  257.  
  258. 
  259. File: java-linux-HOWTO.2.0.info,  Node: What can I do with Java implementation binaries?,  Next: Which parts of the Java sources are freely redistributable?,  Prev: Are Java programs and applets freely redistributable?,  Up: Java as Freely Redistributable Software
  260.  
  261. What can I do with Java implementation binaries?
  262. ================================================
  263.  
  264.    The Sun licensing page has this to say:
  265.      The unmodified Java and HotJava binary releases may be
  266.      redistributed free of charge in both commercial and non-commercial
  267.      applications.
  268.  
  269.    Also:
  270.      Companies or individuals who wish to create a new port of the Java
  271.      language have the right under this agreement to post the binaries
  272.      of that port to the Internet for use by others, as long as the
  273.      port is free of charge and passes the publicly available test
  274.      suites. (Test suites will be available sometime in the first half
  275.      of 1996.) The "diffs" may also be posted on the web as long as the
  276.      underlying source code is not posted. The Java source code is
  277.  
  278.    So if you've got a working Java or HotJava binary, you can give it
  279. to your buddies.  Or put it on a CD-ROM.  Or do anything except patch
  280. it and represent the patched version as Java.  (This is reasonable.
  281. Sun obviously can't leave itself without recourse against Trojan horses
  282. sailing under the Java banner.)  Binaries are FRS.
  283.  
  284. 
  285. File: java-linux-HOWTO.2.0.info,  Node: Which parts of the Java sources are freely redistributable?,  Next: What is Sun's attitude towards FRS Java implementations and tools?,  Prev: What can I do with Java implementation binaries?,  Up: Java as Freely Redistributable Software
  286.  
  287. Which parts of the Java sources are freely redistributable?
  288. ===========================================================
  289.  
  290.    According to Sun's licensing page, none of it is.  But that sounds
  291. harsher than it is.  In practice, anyone can get the Java and HotJava
  292. sources for educational, porting, and non-commercial purposes by
  293. filling out a Web form which obligates them not to redistribute the
  294. sources.  And the agreement `does' permit redistribution of diffs
  295. against the sources.
  296.  
  297.    The only circumstance that requires you to sign a commercial license
  298. with Sun and pay them money is if you want to use the sources in a
  299. commercial product.  In particular, the way the language is written,
  300. it's within the letter and spirit of the agreement for you to sign
  301. Sun's noncommercial source license, snarf the source, port it, and give
  302. away the resulting binaries as completely unencumbered freeware!
  303.  
  304.    Sun says that its primary purpose in keeping as much control as it
  305. has is to keep the language from mutating into incompatible dialects.
  306. The license language supports this; it seems to have been designed to
  307. allow hackers to play for free.
  308.  
  309. 
  310. File: java-linux-HOWTO.2.0.info,  Node: What is Sun's attitude towards FRS Java implementations and tools?,  Next: Is anyone cloning Java in freely redistributable source?,  Prev: Which parts of the Java sources are freely redistributable?,  Up: Java as Freely Redistributable Software
  311.  
  312. What is Sun's attitude towards FRS Java implementations and tools?
  313. ==================================================================
  314.  
  315.    The Sun licensing page says:
  316.      The specifications for the Java Language and the Java Virtual
  317.      Machine are OPEN and are copyrighted by Sun Microsystems, Inc.
  318.  
  319.      Reimplementations of the Java Compiler or the Java Runtime
  320.      Interpreter are permitted without requiring a license from Sun
  321.      provided such implementations are created directly from the
  322.      published specifications and without the direct or indirect use of
  323.      Sun's own implementations or other intellectual property rights,
  324.      including trademarks.
  325.  
  326.    So if you want to go to the effort of creating a Java clone from the
  327. published specifications that is FRS, Sun won't stop you.
  328.  
  329.    Sun people use the term "rogue port" for Java implementations that
  330. either (a) are performed outside Sun, or (b) don't rely on Sun-licensed
  331. code (sometimes the term seems to mean one thing, sometimes the other).
  332. They seem to think some of these already exist, but we don't know
  333. where they are, nor if they are FRS.  They're pretty relaxed about the
  334. situation.
  335.  
  336.    Sun has a Java validation suite.  They have said they'll certify any
  337. Java port that passes it.  (Whether this validation will cost money is
  338. unknown, but Sun says in writing that the suite wil be "publicly
  339. available" in 1996, which at least hints that it will not.) They're
  340. prepared to certify rogue ports, though this apparently hasn't happened
  341. yet.
  342.  
  343. 
  344. File: java-linux-HOWTO.2.0.info,  Node: Is anyone cloning Java in freely redistributable source?,  Next: Are there any FRS Java Tools?,  Prev: What is Sun's attitude towards FRS Java implementations and tools?,  Up: Java as Freely Redistributable Software
  345.  
  346. Is anyone cloning Java in freely redistributable source?
  347. ========================================================
  348.  
  349.    There is a clone of the Java compiler in early development.  It's
  350. called guavac.  You can find more information at
  351.  
  352.    There is a rumor afloat that Cygnus Software's GROW project has
  353. plans for a Java byte code interpreter to be issued under GPL.
  354. However, they haven't yet responded to a query about this.  You can get
  355. details on the GROW project at .
  356.  
  357.    Erik Troan of Red Hat is attempting to put together a development
  358. group to do the rest of the job.  Right now it looks like Erik will do
  359. the class library and your humble editor will do the byte-code
  360. interpreter (if Cygnus hasn't gotten there first).  This project has
  361. been tentatively named "Mr. Coffee".  Your editor would now prefer to
  362. call it "joe" (for Java Open to Everyone) but that name is taken.
  363.  
  364. 
  365. File: java-linux-HOWTO.2.0.info,  Node: Are there any FRS Java Tools?,  Prev: Is anyone cloning Java in freely redistributable source?,  Up: Java as Freely Redistributable Software
  366.  
  367. Are there any FRS Java Tools?
  368. =============================
  369.  
  370.    There is a GNU Emacs mode for editing Java.  You can fetch it from .
  371. Note: this mode assumes you're using c++-mode.el, and won't work with
  372. the cc-mode.el distributed with Emacs 19.
  373.  
  374. 
  375. File: java-linux-HOWTO.2.0.info,  Node: Java On Linux Questions,  Next: Building the Linux Java port on stock Linuxes,  Prev: Java as Freely Redistributable Software,  Up: Top
  376.  
  377. Java On Linux Questions
  378. ***********************
  379.  
  380.    Here you can learn the nuts and bolts of getting Java running on
  381. your Linux.
  382.  
  383. * Menu:
  384.  
  385. * Are Java and HotJava included in any of the Linux distributions?::
  386. * How can I get the latest Java distribution for Linux?::
  387. * What environment will I need to run Java?::
  388. * Do I need Netscape? Can I use Netscape?::
  389. * What mailing lists or newsgroups exist for supporting Java on Linux?::
  390.  
  391. 
  392. File: java-linux-HOWTO.2.0.info,  Node: Are Java and HotJava included in any of the Linux distributions?,  Next: How can I get the latest Java distribution for Linux?,  Up: Java On Linux Questions
  393.  
  394. Are Java and HotJava included in any of the Linux distributions?
  395. ================================================================
  396.  
  397.    No, not yet, but expect it any week now.
  398.  
  399. 
  400. File: java-linux-HOWTO.2.0.info,  Node: How can I get the latest Java distribution for Linux?,  Next: What environment will I need to run Java?,  Prev: Are Java and HotJava included in any of the Linux distributions?,  Up: Java On Linux Questions
  401.  
  402. How can I get the latest Java distribution for Linux?
  403. =====================================================
  404.  
  405.    Look in .  The latest Java-for-Linux can be downloaded from there.
  406. You should browse the  first.
  407.  
  408.    The files you'll need are linux.jdk.common.tar.gz and one of either
  409. linux.jdk.x86-static-motif-bin.tar.gz ot
  410. linux.jdk.x86-shared-motif-bin.tar.gz, depending on whether you have
  411. Motif shared libraries on your system.
  412.  
  413.    This port (from the Sun sources by Randy Chapman) is the one that's
  414. referred to (as the JDK) elsewhere in this HOWTO.
  415.  
  416. 
  417. File: java-linux-HOWTO.2.0.info,  Node: What environment will I need to run Java?,  Next: Do I need Netscape? Can I use Netscape?,  Prev: How can I get the latest Java distribution for Linux?,  Up: Java On Linux Questions
  418.  
  419. What environment will I need to run Java?
  420. =========================================
  421.  
  422.    For starters, you need an ELF-based Linux.  There is no a.out
  423. support, and at the speed the Linux world is switching over to ELF
  424. there is not likely to be any in the future.
  425.  
  426.    You need a 1.2.13 or later kernel.  Kernels 1.2.12 and older seem to
  427. have a bug in getcwd(3) that tanks bin/javac because it doesn't check
  428. the getcwd(3) return code.
  429.  
  430.    You'll need these pieces:
  431.  
  432.    * libc.so.5 => /lib/libc.so.5.2.16
  433.      (The standard C library)
  434.  
  435.    * libX11.so.6 => /usr/X11/lib/libX11.so.6.0
  436.      (The base X11R6 library)
  437.  
  438.    * libXt.so.6 => /usr/X11/lib/libXt.so.6.0
  439.      (The Athena toolkit library)
  440.  
  441.    * libXext.so.6 => /usr/X11/lib/libXext.so.6.0
  442.      (The X extensions library)
  443.  
  444.    * libXpm.so.4 => /usr/X11/lib/libXpm.so.4.3
  445.      (The X library for pixmap handling.)
  446.  
  447.    * libdl.so.1 => /lib/libdl.so.1.7.9
  448.      (Linux dynamic-loader support)
  449.  
  450.    The C and X support libraries may be in your Linux already.
  451.  
  452.    If you don't already have it, get libc.5.2.16.bin.tar.gz from .
  453. Uncompress and untar and copy the files in the lib subdirectory of the
  454. top level of the hierarchy to /lib.
  455.  
  456.    If you don't have a current version of ld.so (or libdl.so.1.7.*) you
  457. will need to update. ld.so.1.7.9 and .11 will work; .10 and other early
  458. versions will not. Get ld-so.1.7.11.tar.gz from ; Uncompress and untar
  459. it and run `instldso.sh' which is in the top level of the resulting
  460. hierarchy.
  461.  
  462.    You can get an Xpm library that will work from .
  463.  
  464. 
  465. File: java-linux-HOWTO.2.0.info,  Node: Do I need Netscape? Can I use Netscape?,  Next: What mailing lists or newsgroups exist for supporting Java on Linux?,  Prev: What environment will I need to run Java?,  Up: Java On Linux Questions
  466.  
  467. Do I need Netscape? Can I use Netscape?
  468. =======================================
  469.  
  470.    Yes, you need Netscape.  HotJava isn't yet available for the beta
  471. release.  Randy Chapman says:
  472.      Sun massively changed the awt interface when they shipped the beta
  473.      JDK and have not yet converted HotJava to it.  They have promised
  474.      they will, and it should work great with linux-jdk when they
  475.      release it.
  476.  
  477.    It's unknown when this will happen.
  478.  
  479.    Netscape versions starting from 2.0b3 is Java-aware.  It is
  480. available at ftp$1-7$.netscape.com (i.e. at ftp1.netscape.com,
  481. ftp2.netscape.com,... etc.)  Version 2.0b4 will allow you to read
  482. applets from file: URLs, 2.0b3 didn't.  This should be a big help for
  483. folks with small-memory machines (they don't need an httpd running).
  484.  
  485.    The file to get is
  486. /2.0b4/unix/netscape-v20b4-export.i486-unknown-linux.tar.Z.
  487.  
  488.    Note that Netscape 2.0b3 or 4 will run on an a.out system, so it is,
  489. in theory, possible to write your java app, give it to someone else to
  490. compile (like maybe the ), and see the output on your system.  If you
  491. want more than that, get an ELF system.
  492.  
  493.    Make sure CLASSPATH is `not' set before running netscape; having it
  494. set seems to crash Netscape, and if you follow the directions below it
  495. won't need tweaking.
  496.  
  497.    The Linux Netscape port has a few known problems.  It doesn't do
  498. sound.  Only 8-bit displays work; 16bpp displays yield crashes.  The
  499. 2.0b3 version occasionally yields bus errors when caling the dispose
  500. method for frames.  While it's pretty robust otherwise, Gamelan's
  501. `Impressionism' applet is known to crash it.
  502.  
  503. 
  504. File: java-linux-HOWTO.2.0.info,  Node: What mailing lists or newsgroups exist for supporting Java on Linux?,  Prev: Do I need Netscape? Can I use Netscape?,  Up: Java On Linux Questions
  505.  
  506. What mailing lists or newsgroups exist for supporting Java on Linux?
  507. ====================================================================
  508.  
  509.    * `java-linux' (Maintained by karl@blackdown.org) Discussions and
  510.      developments concerning the port of Java to the Linux operating
  511.      system. Email to
  512.  
  513.      with the word `subscribe' in the subject to be added to the list.
  514.  
  515.    * `java-linux-announce' (Maintained by karl@blackdown.org) Moderated
  516.      list for announcements concerning the Java-Linux porting projects.
  517.      Please send e-mail to
  518.  
  519.      with the word subscribe in the subject, to be added to the list.
  520.  
  521.    *  Newsgroup for general Java discussion.
  522.  
  523.    *  Newsgroup for discussion of the HotJava browser.
  524.  
  525. 
  526. File: java-linux-HOWTO.2.0.info,  Node: Building the Linux Java port on stock Linuxes,  Next: Viewing Applets,  Prev: Java On Linux Questions,  Up: Top
  527.  
  528. Building the Linux Java port on stock Linuxes
  529. *********************************************
  530.  
  531.    In this section, we collect recipes sent to us for building Randy
  532. Chapman's Java port on various current Linux distributions:
  533.  
  534. * Menu:
  535.  
  536. * Slackware distribution ELF kernel 1-2-13-::
  537. * RedHat 2-1/Caldera Preview 2::
  538. * Unifix::
  539.  
  540. 
  541. File: java-linux-HOWTO.2.0.info,  Node: Slackware distribution ELF kernel 1-2-13-,  Next: RedHat 2-1/Caldera Preview 2,  Up: Building the Linux Java port on stock Linuxes
  542.  
  543. Slackware distribution ELF kernel 1-2-13-
  544. =========================================
  545.  
  546.    John Franks <john@math.nwu.edu> writes that he succeeded with the
  547. following steps:
  548.  
  549.    * Get linux-x86.jdk.pre2.static-motif.tar.gz from
  550.  
  551.      and uncompress it and untar it.  (The filenames you must fetch
  552.      have changes for the 1.0 beta JDK.)
  553.  
  554.    * Get libc.5.2.16.bin.tar.gz (binary distribution, not source) from
  555.  
  556.      Uncompress and untar and copy the files in the lib subdirectory of
  557.      the top level of the hierarchy to /lib.  Make sure that
  558.      /lib/libc.so.5 is a symlink to this file.
  559.  
  560.    * Get ld-so.1.7.11.tar.gz from ftp://ftp.ods.com/linux/ Uncompress
  561.      and untar it and run "instldso.sh" which is in the top level of
  562.      the resulting hierarchy.
  563.  
  564.    You should now be able to compile and try the "hello world" program
  565. and applet from Sun following the instructions at .
  566.  
  567. 
  568. File: java-linux-HOWTO.2.0.info,  Node: RedHat 2-1/Caldera Preview 2,  Next: Unifix,  Prev: Slackware distribution ELF kernel 1-2-13-,  Up: Building the Linux Java port on stock Linuxes
  569.  
  570. RedHat 2-1/Caldera Preview 2
  571. ============================
  572.  
  573.    Steve Greene <sgreene@access.digex.net> reports success doing the
  574. following steps.  I have edited the recipe slightly, so blame any
  575. mistakes on me.  The `JDK' he refers to is the Chapman port of the Java
  576. Developer's Kit.
  577.  
  578.    * From a Red Hat mirror site, get the rpm available for
  579.      ld.so.1.7.11.  To find it, check any RedHat mirror site for:
  580.  
  581.      /pub/mirrors/redhat-2.1/updates/RPMS/ld.so-1.7.11-i386.rpm
  582.  
  583.      I know it is available at ftp.pht.com, ftp.caldera.com. and is
  584.      probably at the other RedHat mirrors as well.  Grab it, and do
  585.      `rpm -Uvh ld.so-1.7.11-1.i386.rpm' on your system.
  586.  
  587.    * Red Hat 2.0 and Caldera Preview 2 users may need the `which'
  588.      program (it's called by some of the scripts in the JDK).  An rpm
  589.      file for `which' is available at the usual Red Hat mirror sites as
  590.      part of the Red Hat 2.1 distribution files.  Get and install
  591.      which-1.0.i386.rpm.  RedHat 2.1 users should already have which on
  592.      their system or available within their original distribution.
  593.  
  594.    *  Get the tar file(s) for the statically-linked JDK.  Untar it from
  595.      a convenient point.  I put mine in /usr/local, so the untar
  596.      creates /usr/local/java/....
  597.  
  598.    *  So you can run java as someone other than root (this is a good
  599.      idea!), do `chmod 666 /dev/zero'.   Red Hat and Caldera have the
  600.      wrong permissions set on this device out of the box.
  601.  
  602.    *  If you haven't already, run ldconfig as root to load the new
  603.      libraries.  If you do "ldconfig -v"  you can verify you have all
  604.      the libraries loaded.  (At least we don't have to build an ELF
  605.      system first!)
  606.  
  607.    *  Make sure you're logged in as a user (e.g. non-root).  Start X-
  608.      windows, open an X-Term, and try something!
  609.  
  610. 
  611. File: java-linux-HOWTO.2.0.info,  Node: Unifix,  Prev: RedHat 2-1/Caldera Preview 2,  Up: Building the Linux Java port on stock Linuxes
  612.  
  613. Unifix
  614. ======
  615.  
  616.    Stefan Middendorf writes: Unifix is a popular German-language Linux
  617. distribution. There are a few distributions based on it: Linux Universe,
  618. sold in USA, Linux 4U, currently only distributed in Germany and Linux
  619. FT in Britain.  This recipe is known to work for Unifix 1.7, Linux 4U
  620. 1st Edition, Linux Universe 2nd Edition, and Linux FT 1.1.
  621.  
  622.    * Put linux-x86.jdk.pre2.static-motif.tar.gz from
  623.  
  624.      in /usr/local and uncompress it and untar it.
  625.  
  626.    * Change the first line of the script .java_wrapper from PRG=`which
  627.      $0` >/dev/null 2>&1 to
  628.  
  629.      PRG=`type $0 | cut -d ' ' -f 3` >/dev/null 2>&1
  630.  
  631.    * Get libc-5.2.18.bin.tar.gz (I succeeded with
  632.      libc-5.2.16.bin.tar.gz, too), extract and uncompress it in the /
  633.      drectory.
  634.  
  635.    * Get ld-so.1.7.12.tar.gz from tsx-11.mit.edu (or any mirror site)
  636.      and uncompress and untar it, e.g. in /usr/local.  Change to the
  637.      resulting directory and run instldso.sh. This will also run
  638.      ldconfig.  Probably newer versions of ld-so will work too.
  639.  
  640.    * Add /usr/local/java/bin to the PATH environment variable.
  641.  
  642.    * Get netscape-v20b4-export.i486-unknown-linux.tar.Z, extract and
  643.      uncompress it in /usr/local/<yourNetscapeDir>.
  644.  
  645.    * Create a Link in /usr/local/bin to ../<yourNetscapeDir>/netscape.
  646.  
  647.    * Put /usr/local/<yourNetscapeDir>/moz2_0.zip in
  648.      /usr/local/lib/netscape/.
  649.  
  650.    As an alternative to changing your PATH, Ralf Strobel suggests:
  651.  
  652.    *  Copy the scripts .java_wrapper and appletviewer and the links
  653.      @java @javac, @javadoc, @javap, and @jdb from /usr/local/java/bin
  654.      to /usr/local/bin and you can use them wherever you are.
  655.  
  656.    * In /java/bin/i586 you can add a script called `javadoc`
  657.  
  658.      #!/bin/sh `dirname $0`/java sun.tools.javadoc.Main -d
  659.      <yourhtmldir> $*
  660.  
  661.      where if you are user jrandom, <yourhtmldir> would be
  662.      jrandom/.java-html.
  663.  
  664. 
  665. File: java-linux-HOWTO.2.0.info,  Node: Viewing Applets,  Next: Notes on Known Problems,  Prev: Building the Linux Java port on stock Linuxes,  Up: Top
  666.  
  667. Viewing Applets
  668. ***************
  669.  
  670.    To run a demo without going through the applet viewer, you can enter
  671. this command from the top of my Java directory tree (/usr/local/java on
  672. most systems):
  673.  
  674.    bin/java sun.applet.AppletViewer demo/<directory_name>/exampleN.html
  675.  
  676.    where <directory name> is the subdirectory off demo, and N is the
  677. number of the example file (some directories have more than one).
  678.  
  679.    Steve Greene says: I've started the tutorials available from Sun's
  680. java site and the similar one put out by the NTMUG.  I've discovered
  681. some problems with the syntax in Sun's tutorial, so I've been following
  682. the NYMUG tutorial instead for now.
  683.  
  684.    The appletviewer expects as an argument, an html file with an APPLET
  685. tag inside it.
  686.  
  687.    For example, if your html file Hello.html looks like:
  688.  
  689.         <HTML>
  690.         <HEAD>
  691.         <TITLE> Hello test program </TITLE>
  692.         < /HEAD>
  693.         <BODY>
  694.         This is an appletviewer test
  695.         <APPLET CODE="Hello1.class" WIDTH=150 HEIGHT=25>
  696.         < /APPLET>
  697.         < /BODY>
  698.         < /HTML>
  699.  
  700.    (If you see "< /" in the above, ignore the space.  It's a workaround
  701. for a formatter bug.)
  702.  
  703.    Running "appletviewer Hello.html" will show you the applet. One
  704. advantage of using the appletviewer is that events sent to the applet
  705. (start(), init(), etc) are in compliance with Sun specs as opposed to
  706. Netscape 2.0b4 (probably a bug in Netscape).
  707.  
  708.    A disadvantage of using the appletviewer is that it is much more
  709. slower than Netscape.
  710.  
  711.    The first time you run Java, a license screen resembling Netscape's
  712. will be displayed.
  713.  
  714. 
  715. File: java-linux-HOWTO.2.0.info,  Node: Notes on Known Problems,  Next: Related Resources,  Prev: Viewing Applets,  Up: Top
  716.  
  717. Notes on Known Problems
  718. ***********************
  719.  
  720. * Menu:
  721.  
  722. * GNU Make breaks after I install Java::
  723. * You get `dirname: too many arguments' errors::
  724. * You get `cannot find class java/lang/Thread' errors::
  725. * An error message refers to /dev/zero::
  726. * SEGFAULT::
  727. * bin/java bin/javac or bin/appletviewer gives you a help screen::
  728. * Applets show in the viewer but not when put on a web server::
  729. * Problem Logging::
  730.  
  731. 
  732. File: java-linux-HOWTO.2.0.info,  Node: GNU Make breaks after I install Java,  Next: too many arguments' errors:,  Up: Notes on Known Problems
  733.  
  734. GNU Make breaks after I install Java
  735. ====================================
  736.  
  737.    Recent versions of libc fix a bug which masked a bug in GNU Make (the
  738. symptom is that make doesn't look in Makefile for rules).  The libc
  739. 5.2.8 release notes give a patch to make that fixes the problem.
  740.  
  741. 
  742. File: java-linux-HOWTO.2.0.info,  Node: You get `dirname: too many arguments' errors
  743.  
  744. You get `dirname: too many arguments' errors
  745. ============================================
  746.  
  747.    Your CLASSPATH variable is not correctly initialized.  In
  748. .java_wrapper, there is code akin to the follwing:
  749.  
  750.         PRG=`which $0`
  751.         J_HOME=`dirname $PRG`/..
  752.  
  753.    Unfortunately, linux's standalone which command is hideously broken,
  754. and certain shells will set $0 to the full pathname.  Randy Chapman
  755. says the fix is either to use:
  756.  
  757.          J_HOME=`dirname $0`/..
  758.  
  759.    Or, safer:
  760.  
  761.          J_HOME=/usr/local/java
  762.  
  763.    An alternate fix from Dave Dittrich is:
  764.  
  765.          PRG=`csh -c "which $0"`
  766.  
  767.    And another one from Tim Farnum is to change the PRG=`which $0` line
  768. to
  769.  
  770.          PRG=$0
  771.  
  772.    Lutz Behnke suggests:
  773.  
  774.          PRG=`type -path $0` >/dev/null 2>&1
  775.  
  776.    A similar change also needs to be made to the appletviewer script.
  777.  
  778. 
  779. File: java-linux-HOWTO.2.0.info,  Node: You get `cannot find class java/lang/Thread' errors,  Next: An error message refers to /dev/zero,  Prev: too many arguments' errors:,  Up: Notes on Known Problems
  780.  
  781. You get `cannot find class java/lang/Thread' errors
  782. ===================================================
  783.  
  784.    Your CLASSPATH variable is not correctly initialized.  See above.
  785.  
  786. 
  787. File: java-linux-HOWTO.2.0.info,  Node: An error message refers to /dev/zero,  Next: SEGFAULT,  Prev: You get `cannot find class java/lang/Thread' errors,  Up: Notes on Known Problems
  788.  
  789. An error message refers to /dev/zero
  790. ====================================
  791.  
  792.    Go root and do `chmod 666 /dev/zero'.
  793.  
  794. 
  795. File: java-linux-HOWTO.2.0.info,  Node: SEGFAULT,  Next: bin/java bin/javac or bin/appletviewer gives you a help screen,  Prev: An error message refers to /dev/zero,  Up: Notes on Known Problems
  796.  
  797. SEGFAULT
  798. ========
  799.  
  800.    Occasionally, you may get a screen full of error messages, and the
  801. system cheerfully fills up your swap space and locks-up.
  802.  
  803.    You're probably missing a library someplace.  Rerun ldconfig -v and
  804. see what's missing. Perhaps LD_LIBRARY_PATH or CLASS_PATH is not set.
  805. Finally, some applets are buggy or lock up the Linux JDK.
  806.  
  807.    (BTW, you can stop the lock-up by having another Xterm open with top
  808. running; use top to kill the java process BEFORE it fills up swap and
  809. hangs your system!)
  810.  
  811.    Java seems to want lots of resources, so I'd keep the number of
  812. running/open apps on my desktop to a minimum.  It will load on a
  813. 486DX-2-75 with 8 Mbytes RAM and 16 Mbytes swap (it'll take a minute,
  814. though).  I was able to get two animation applets running
  815. simultaneously (sort of) before my system ran out of swap space and
  816. hung.
  817.  
  818. 
  819. File: java-linux-HOWTO.2.0.info,  Node: bin/java bin/javac or bin/appletviewer gives you a help screen,  Next: Applets show in the viewer but not when put on a web server,  Prev: SEGFAULT,  Up: Notes on Known Problems
  820.  
  821. bin/java bin/javac or bin/appletviewer gives you a help screen
  822. ==============================================================
  823.  
  824.    You left out some command-line parameter.
  825.  
  826. 
  827. File: java-linux-HOWTO.2.0.info,  Node: Applets show in the viewer but not when put on a web server,  Next: Problem Logging,  Prev: bin/java bin/javac or bin/appletviewer gives you a help screen,  Up: Notes on Known Problems
  828.  
  829. Applets show in the viewer but not when put on a web server
  830. ===========================================================
  831.  
  832.    A common error which causes these results is failing to get the MIME
  833. type of the applet correct.  Your server should send a header with the
  834. applet indicating that its MIME type is "text/plain",
  835. "application/octet-stream", or some other type that doesn't have a
  836. defined special handler on the client side.  How you arrange this
  837. depends on which server you are using. (John Franks)
  838.  
  839.    It's also been alleged that tinyhttpd, an HTTP server written in
  840. Perl, returns a bad content type.  Apache, OTOH, is pretty reliable.
  841.  
  842. 
  843. File: java-linux-HOWTO.2.0.info,  Node: Problem Logging,  Prev: Applets show in the viewer but not when put on a web server,  Up: Notes on Known Problems
  844.  
  845. Problem Logging
  846. ===============
  847.  
  848.    Joey Oravec tells us that HotJava keeps a log of what it does and
  849. any problems in encounters. If you're up to diagnosing something
  850. yourself, look at $HOME/.hotjava/weblog in the user's home directory.
  851. That file will make it more obvious if you're perhaps missing a library
  852. or something.
  853.  
  854. 
  855. File: java-linux-HOWTO.2.0.info,  Node: Related Resources,  Next: To Be Added--,  Prev: Notes on Known Problems,  Up: Top
  856.  
  857. Related Resources
  858. *****************
  859.  
  860.    For general information on Java, there is a FAQ maintained on the
  861.  
  862.    newsgroup; it is available at .
  863.  
  864.    There is an older FAQ-style document by Joey Oravec
  865.  
  866.    which primarily refers to the alpha release.  You can find it at .
  867. At some point these documents may merge.
  868.  
  869.    Here are some Java-related pages:
  870.  
  871.    *  
  872. File: java-linux-HOWTO.2.0.info,  Node: To Be Added--,  Next: Acknowledgements,  Prev: Related Resources,  Up: Top
  873.  
  874. To Be Added--
  875. *************
  876.  
  877.    *  More recipes for specific Linux variants.
  878.  
  879. 
  880. File: java-linux-HOWTO.2.0.info,  Node: Acknowledgements,  Prev: To Be Added--,  Up: Top
  881.  
  882. Acknowledgements
  883. ****************
  884.  
  885.    Grateful acknowledgement is made to all contributors, including:
  886.    * John Franks <john@math.nwu.edu>
  887.  
  888.    * Zachary DeAquila <zachary@zachs.place.org>
  889.  
  890.    * Steve Greene <sgreene@access.digex.net>
  891.  
  892.    * Dave Dittrich <dittrich@cac.washington.edu>
  893.  
  894.    * Dave Flanagan <dave@ora.com>
  895.  
  896.    * Joey Oravec <mailto:joey@sun.science.wayne.edu>
  897.  
  898.    * Adam Smith <aws@cs.brown.edu>
  899.  
  900.    * Joe Buck <jbuck@Synopsys.COM>
  901.  
  902.    * Omar Loggiodice <ologgio@netdepot.com>
  903.  
  904.    * Stefan Middendorf <mdorf@stud.fh-heilbronn.de<
  905.  
  906.    This version incorporates Steve Greene's rumored but never-published
  907. Red Hat/Caldera mini-HOWTO.  I've also swiped some stuff I consider
  908. useful off Joey Oravec's page - special thanks to him.
  909.  
  910.    For other HOWTOs and FAQs I maintain, see my home page at .
  911.  
  912.  
  913. 
  914. Tag Table:
  915. Node: Top135
  916. Node: Introduction736
  917. Node: General Questions About Java and HotJava1295
  918. Node: What are are Java and HotJava and why are they interesting?1944
  919. Node: Where do Java and HotJava come from? Who can use them?3414
  920. Node: How mature is Java?4637
  921. Node: Where can I find documentation on Java and HotJava?5509
  922. Node: Yes but where can I find paper documentation?6002
  923. Node: Where can I find on-line collections of Java code?9267
  924. Node: Java as Freely Redistributable Software9801
  925. Node: Are Java programs and applets freely redistributable?11041
  926. Node: What can I do with Java implementation binaries?11508
  927. Node: Which parts of the Java sources are freely redistributable?12900
  928. Node: What is Sun's attitude towards FRS Java implementations and tools?14319
  929. Node: Is anyone cloning Java in freely redistributable source?16126
  930. Node: Are there any FRS Java Tools?17264
  931. Node: Java On Linux Questions17694
  932. Node: Are Java and HotJava included in any of the Linux distributions?18303
  933. Node: How can I get the latest Java distribution for Linux?18679
  934. Node: What environment will I need to run Java?19482
  935. Node: Do I need Netscape? Can I use Netscape?21232
  936. Node: What mailing lists or newsgroups exist for supporting Java on Linux?23070
  937. Node: Building the Linux Java port on stock Linuxes23977
  938. Node: Slackware distribution ELF kernel 1-2-13-24455
  939. Node: RedHat 2-1/Caldera Preview 225512
  940. Node: Unifix27499
  941. Node: Viewing Applets29504
  942. Node: Notes on Known Problems31239
  943. Node: GNU Make breaks after I install Java31776
  944. Node: You get `dirname: too many arguments' errors32204
  945. Node: You get `cannot find class java/lang/Thread' errors33120
  946. Node: An error message refers to /dev/zero33501
  947. Node: SEGFAULT33805
  948. Node: bin/java bin/javac or bin/appletviewer gives you a help screen34848
  949. Node: Applets show in the viewer but not when put on a web server35242
  950. Node: Problem Logging36113
  951. Node: Related Resources36594
  952. Node: To Be Added--37068
  953. Node: Acknowledgements37270
  954. 
  955. End Tag Table
  956.