r12 - 27 May 2009 - 18:58:55 - JohnPerkinsYou are here: TWiki >  CSDocs Web  > JavaOnCSLWorkstations

Java On Computer Systems Lab Workstations

What Java Development Tools Are Installed?

Java products installed currently include the JDK (Java SE Development Kit), jikes , and the Eclipse IDE.

Java SE Development Kit (JDK)

The Java SE Development Kit (jdk version x) is installed as /s/jdkx where x is the version number. The default version of java tools can be accessed via /s/std/bin on UNIX platforms and S:\std\bin on Windows XP. We do not generally change default versions of software mid-semester. If you want to use a newer version of the jdk that is installed, but has not yet been made the default on UNIX, you must set your PATH enviroment variable to include /s/jdkx/bin before /s/std/bin or access the desired version via the full path. There are many old versions of the jdk installed but we recommend you only use the latest for security reasons. Some of the installed versions and platforms include:

  • jdk 1.5.0_10
    • Sparc Solaris
    • x86 Linux
    • Windows 2000/XP

  • jdk 1.6.0_11 (current default version for all supported platforms)
    • Sparc Solaris
    • x86 Linux
    • Windows XP

Important

Please realize that Java is an evolving language. Some of the versions installed will be more stable than others or have different features. Please refer to the README* files or the documentation in the respective directories for more information on the specifics of each version.

Documentation

Online documentation for the default version can be referenced at /s/java/docs. Older versions may have a docs directory as well. Make sure you are looking at the correct docs if you are not using the default version of the jdk. e.g. If for some reason you want to use jdk 1.4.2_03, reference the documentation at /s/jdk1.4.2_03/docs

A word about threads on Solaris

Java 2 no longers supports green threads on solaris. Only native threads are implemented/supported. Java 1 has both, but native threads are enabled by default.

Setting your environment to use jdk.

If you want to use a newer version of the jdk that is installed, but has not yet been made the default, you must set your PATH enviroment variable to include /s/jdkx/bin before /s/std/bin.

It should no longer be necessary to set your JAVA_HOME or CLASSPATH environment variables when using the default jdk and you may even run into problems if they are set, so it would be best to unset them and let java set them automatically. (NOTE: of course you may still need to use CLASSPATH to find application-specific classes, but it is not needed to find the classes that come with the jdk, unless you are using the jikes compiler, which does require the use of CLASSPATH to find the standard java classes.)

/s/java-1 points to the most recent version of jdk 1.1.x for each supported platform. /s/java-2 points to the current default (same version as that accessed from /s/std/bin ). Note that /s/java-2 does not necessarily give you the most recent version of java 2 (jdk 1.2.x) but rather the default version.

Jikes Java Compiler

Jikes is a java compiler developed by IBM's AlphaWorks division.

Installed versions and platforms include:

  • jikes 1.10
    • Runs on:
      • Sparc Solaris 2.x
      • x86 Solaris 2.x
      • Linux x86
  • jikes 1.12
    • Installed in /s/jikes-1.12
    • Runs on:
      • Sparc Solaris 2.x
      • x86 Solaris 2.x
      • Linux x86
      • Windows NT/2000
  • jikes 1.14
    • Installed in /s/jikes-1.14
    • Runs on:
      • Sparc Solaris 2.x
      • x86 Solaris 2.x
      • Linux x86
      • Windows 2000
  • jikes 1.18 (current default version)
    • Installed in /s/jikes-1.18
    • Runs on:
      • Sparc Solaris 8
      • Red Hat and Tao Linux x86
      • Windows 2000
  • jikes 1.20
    • Installed in /s/jikes-1.20
    • Runs on:
      • Sparc Solaris 8
      • Red Hat and Tao Linux x86
      • Windows 2000
  • jikes 1.22
    • Installed in /s/jikes-1.22
    • Runs on:
      • Sparc Solaris 8
      • Red Hat and Tao Linux x86
      • Windows 2000

Setting your environment to use jikes.

You will need to set your CLASSPATH appropriately to use the jikes compiler. The value of CLASSPATH is determined by the java target you are compiling for. See the jikes man page (man jikes) for more information on the default java target and specifying an alternate java target version. NONE of the above versions of jikes support new features added to jdk 1.5.x (though you can use the jdk 1.5.x rt.jar classes file starting with jikes 1.22) so you should not refer to the default java classes nor the default java documentation (both currently set to 1.5.x) unless you are using jikes 1.22 or greater.

Setting CLASSPATH can be accomplished by modifying your .bashrc.local or .cshrc.local file.

For example, if you want to target java 1.4, you should reference documentation at /s/jdk1.4.2_03/docs and set your CLASSPATH appropriately by adding the following line to your .bashrc or .cshrc.local file:

bash/ksh:
export CLASSPATH=/s/jdk1.4.2_03/jre/lib/rt.jar:.

tcsh/csh:
setenv CLASSPATH /s/jdk1.4.2_03/jre/lib/rt.jar:.

Refer to our jdk documentation to find out what versions of the jdk are installed on what platforms. We'd recommend you use the classes and documentation from the most recent release of the java target you are interested in.

Eclipse IDE

Eclipse is an open extensible IDE for "anything and nothing in particular". It has been chosen by the faculty as our java development environment for CS 302 on Windows. UNIX versions have also been made available for java development (accessible via /s/std/bin/eclipse). Installed versions and platforms include:

  • Eclipse 3.1.1 (first version that supports new features of java 1.5.x)
    • This version runs on:
      • Windows 2000
      • Linux x86 (also has CDT plugins for C/C++ development)
      • Sparc Solaris

  • Eclipse 3.4 (default version)
    • This version runs on:
      • Windows XP
      • Linux x86 (also has CDT plugins for C/C++ development)

Eclipse should default to the jdk in your path on UNIX (for most people this will be /s/std/bin/java) or the installed jdk on Windows, but you can change the java target by referencing the full path to an alternate jdk via the GUI.

If you want to use a non-default version of eclipse

  • On a "research" Windows workstation, use the csl software configuration tool to install the appropriate version
  • On Unix, access eclipse via the full path. e.g. for version 3.1.1 run /s/eclipse-3.1.1/bin/eclipse

More information on Eclipse can be found at the official Eclipse project website.

Using CVS within Eclipse

NOTE: These instructions were drafted using Eclipse 3.1; newer or older releases may be different.

Create and initialize the CVS repository

From a shell window:

mkdir repository_directory

setenv CVSROOT repository_directory

cvs init

Establish connection to CVS repository within Eclipse

  1. Go to Window -> Show View, open CVS, then select CVS Repositories
  2. In the CVS Repositories window, click the "CVS +" icon to Add CVS Repositories
  3. Fill in information as follows regarding the new repository:

Field Entry
Host localhost
Repository Path repository_directory
User your login
Password your password
Connection type extssh
Port Use default port
Validate connection on finish checked
Save password NOT checked

NOTES:

  1. Windows users should use the hostname of a unix computer they have an account on; specifying localhost or a windows host will not work.
  2. DO NOT check the Save password box; this is a security risk to your account.
  3. Repository Path is the full path to your CVSROOT directory created above on a unix computer. To get this, you can run at a shell prompt: cd repository_directory; pwd and enter the path returned.
  4. Any other collaborators using this CVS repository should use the same repository directory but their own username/passwords. The owner of the repository should add appropriate AFS ACLs to the repository directory when creating the repository.

Checking in a project to a CVS repository

  1. Create your project as normal within Eclipse
  2. When ready to commit the project, right-click on the root directory of the project in your Projects window, then select Team -> Share Project, select the CVS repository to check it into, enter any comments when prompted and click Ok to check in the project.

Checking out a project from a CVS repository

  1. Set up the CVS repository within eclipse as documented above. Do it now if you haven't already.
  2. Open Window menu -> Show View, open CVS, then select CVS Repositories. Your CVS repository should show up in a =CVS Repositories window.
  3. Open the CVS repository, then open HEAD or Branches, depending on what you have done within your CVS repository, right-click on the project you want to work on and select Check Out.

Committing changes and synchronizing with the repository

All such operations are done from the Projects window.

Commits are done by right-clicking on the file/directory with changes and selecting Team -> Commit This commits any local changes to the repository.

General synchronization is done by right-clicking on the file/directory and selecting Team -> Synchronize

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r12 < r11 < r10 < r9 < r8 | More topic actions
 
CSL Home
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback