Running Java and the Java Compiler

It is possible to compile and run Java in the Lab. The current version (suggested) as of August 2004 is J2SDK 1.4.2. This is a native FreeBSD port. Older versions (1.3.1, 1.2.2, 1.1) are also available at the time of writing. Some of these are Linux binaries, because they happened to work better than the FreeBSD native port for that particular version the last time I checked.

To use the most recent recommended Java version, put the following at the beginning of your path:

/usr/local/jdk/bin Documentation for the JDK is at /usr/local/jdk/docs/index.html . HTML source for a very nice reference manual on the Java language is at: /usr/local/langspec-1.0

If you need to use a specific older version of the JDK, instead put /usr/local/jdk1.3.1, /usr/local/jdk1.2.2, etc. in your path.

Java Development Environment for Emacs (JDEE)

The Java Development Environment (JDEE) for Emacs/XEmacs is located in /usr/local/lib/jde2.2.9beta10. This integrates the JDK and Emacs/XEmacs into a Java programming environment. Documentation and pointers to Web pages can be found in that directory. It is recommended that you use the path /usr/local/lib/jde in your .emacs file, as that symbolic link will be updated when a newer version is installed. Specifically, putting the following code in your .emacs file should cause the JDEE to be autoloaded when needed:

(setq exec-path (nconc '( "/usr/local/jdk/bin" ;; Add more directories here: ) exec-path)) (setq load-path (nconc '( "/usr/local/lib/jde/lisp" "/usr/local/lib/semantic" "/usr/local/lib/speedbar" "/usr/local/lib/eieio" ) load-path)) (autoload 'jde-mode "jde" "Java development environment." t) (setq auto-mode-alist (cons '("\\.java$" . jde-mode) auto-mode-alist))
webmaster@ug.cs.sunysb.edu