Java at Boston University

Availability and Setup
SGI's implementation of java is available on all SCV maintained
machines. All files are located under /usr/java. You should make
sure that /usr/java/bin is in your PATH. (This is automatically
done in the default .cshrc file given to new users.) If you feel
a need to set your CLASSPATH don't try to include any system directories,
just include the directories containing your own classes. For more
information see the brief man page on
java
or the more extensive HTML documentation at
file:/usr/java/webdocs/release.html.
Applets Written Locally
Java Help and Documentation
Outside Java Resources
Creating a Simple Applet (Hello World)
Steps
- Save the file HelloWorld.java to
a machine with a Java compiler on it such as CGL or Tonka and make sure to
keep the name HelloWorld.java.
- Compile the file you just saved on that machine using the command
javac HelloWorld.java. This will create a Java bytecode binary file
called HelloWorld.class.
- Copy this HelloWorld.class file onto a machine running
a Web server and place it in an accessible Web directory such as
~username/public_html/. (If you do not have access to a machine
running a Web server, leave the .class file where it is and see the final
step below.)
- Save the file hello.html in the same
place you just placed the .class file. The name of this file is
not important but it must be in the same directory as the .class file.
Make sure the permissions for both this file and the .class file are such
that anyone can access them.
- Launch a Java-capable browser such as Netscape or
appletviewer and open the URL for hello.html and it should
look like this.
- If you did not have access to a machine running a Web server, you
should still be able to view your applet. Launch your Java-capable browser
on the same machine as you placed the .class and .html
files (such as CGL or Tonka). Now use the Open File... command under
the File menu in Netscape to open the .html file by its Unix
directory location on that machine - do not try to specify a URL.
Document Name: java
Author/Maintainer: Aaron D. Fuegi (aarondf@bu.edu)
Executable: /usr/java/bin/javac, /usr/java/bin/java, /usr/java/bin/appletviewer, /usr/sbin/jdev
Libraries: /usr/java/classes/
Other Files: /usr/java/bin/, /usr/Jdev/bin/
Keywords: java, programming, applet
Machines List: IBM pSeries, Linux Cluster, CGL Cluster
Created March 12, 1996; Last Revised July 11, 2000; Last Modified 12:11 29-Sep-04
URL of this document: http://scv.bu.edu/Doc/Java/java.html
Go up to
SCV Help Pages