Java Information

General Information

If you have not used Java before, go to the on-line tutorial referenced below. Then learn Swing, and then Java3D. Do not bother with the graphics capabilities of Swing, since we will use Java3D instead.

I also have a set of simple examples on line in the course account in the scf facility at

~cs582/public/java

This is an scf account, not a URL. A few of these examples are adapted from the book "Java by Dissection" by I. Pohl and C. McDowell, Addison-Wesley, 2000.

There are 3 directories. I suggest that you look at the examples in the following order:

TextExs: These just write to the terminal

SwingExs:

3dExs:


Software

We will be using the following production versions of Java, Swing and Java3D.

We do not seem to have any luck with running on the SUNs this year. So, we will develop and grade on PCs.

I recommend using the compilers directly on a PC run window.

javac ClassName.java

compiles the source into byte code, ClassName.class. Then

java ClassName

runs it. If you have all the source files in the same directory, the system will find what it needs and compile it. Note that the compiler may produce more files than what you expect, and that all are needed and must be submitted.


Development on PCs

Those of you who have PCs may wish to download the software for free as follows:
jdk 1.6.0 -- Java web site.
j3d 1.5.2 -- Java3D web site.
Make sure that you get the versions we are using.

In the PCs the jdk should install without any problems. For j3d make sure you download the installer, not the package itself.

The PC installation has a couple of environmental requirements: (i) you need to have in your PATH variable the value c:\Program Files\Java\jdk1.6.0_23\bin ahead of other entries, or at least ahead of the system directories (assuming that you installed Java in the usual place) or you won't find the javac compiler; and (ii) your CLASSPATH variable must be set to '.' or not set at all, or Java will not find the class files it needs. To set these variables in XP go to Start >> Control Panel >> System >> Advanced >> Environment Variables and scroll to edit 'Path' in the system variables.

Other Versions

Last time I tried I couldn't use the J++ development environment with Swing. Also note that if you use the nice graphic facilities of J++, your byte code will not run in the SUNs. My feeling is that writing the GUI code by hand for the simple things we are doing is easy enough and more instructive than using GUI builders.


Documentation

There are many texts available on Java. I recommend the on-line tutorials available at the java web sites. NOTE:The information on how up to date the documentation is, is not up to date itself :-). It's true as of a couple of years ago, and I'm sure there have been changes. Beware!

In addition to the official Java and Java 3D sites, there is an independent site for Java 3D: Java 3D Organization

Reference manuals for the APIs are also available on line in html format.

USCweb
Copyright © 1996-2011 Aristides Requicha. All RIGHTS RESERVED.
Last Update: January 20, 2011 - Ari Requicha, requicha "At' usc.edu.