JWS for LinuX Mike Gaertner Version 1.1-en 15.08.1996 Using Java WorkShop (JWS) for Solaris/intel on Linux 1. Preface In the past few months many PC-magazines have articles about java and ship with a CD containing applets and demo-programs for java. On some CDs you can find a beta-version of the "Java Workshop", JWS is a Develop Kit, (writing in Java) for Java, whit a Editor, Debuger and Portofolie/Project-Manager. In spite of the platform-independence of Java, there are no instructions on how to install this JWS under Linux. Only WinNT, Windows95, SunSolaris Sparc or SunSolars Intel are mentioned in the documentation coming with the CDs. As I didn't found any description on this on the net, I did it myself and wrote this mini-HOWTO. 2. Requisites Please read the Java-HOWTO for general information about Java under Linux and how to install the nesassary JDK. For the rest of the mini- HOWTO it is assumed that you have 1. the JDK version 1.0 (or better) installed 2. X11R6 (e.g. XFree86 3.1.2 or higher) 3. a CD with JWS in your CD-drive. 3. Installation First you have to decide where to install the JWS. As JWS is not part of a distribution, it may be a good idea to install it in the "/usr/local"-hierarchy. Set environment-variable "JWS_HOME" to point to the directory of your choice and set it permanently in the startup-file of you shell. For example if you use "bash", the startup-files are "/etc/profile" or " /.bash_profile" and the necessary entries would be export JWS_HOME="/usr/local/JWS" export JAVA_HOME="/usr/local/lib/java" The second entry points to the directory where java is installed on your system. If it is not already set, add it to the startup-file, too. On most CDs relating to java you can find the JWS in a sub-directory named workshop. Look for the file inteltar.z which is the version of the JWS for SunSolars/i386. This file is a compressed archive which can be unpacked with tar -xvzf inteltar.z -C ${JWS_HOME} After you have issued this command, you will find the following sub- directories in ${JWS_HOME}: classes, examples, intel-S2, lib, solaris The commands shown below will delete superfluous files from the freshly unpacked JWS and create the necessary links to the already installed java-binaries. You can use them verbatim (e.g. via cut&paste on the command-line). ln -s ${JWS_HOME}/classes ${JAVA_HOME}/lib/classes rm ${JWS_HOME}/intel-S2/bin/i386/* rmdir ${JWS_HOME}/intel-S2/bin/i386 ln -s ${JAVA_HOME}/bin/i586 ${JWS_HOME}/intel-S2/bin/i586 ln -s ${JAVA_HOME}/bin/i486 ${JWS_HOME}/intel-S2/bin/i486 ln -s ${JAVA_HOME}/bin/i386 ${JWS_HOME}/intel-S2/bin/i386 The shell-script for starting JWS is ${JWS_HOME}/intel-S2/bin/jws. Because I modified it heavily, it's appended at the end of this mini- HOWTO. Furthermore you have to change line 8 in ${JWS_HOME}/solaris/bin/javac so it reads: if [ -x ${_SS_JDK_BIN}/bin/`/bin/uname -m`/javac ] Hey, you are already done! End of the show. Only a last hint: if you create a new project with the JWS you must add ${JAVA_HOME}/lib/classes.zip to the environment-varibable "CLASSPATH". 4. Acknowledgements Thanks to Winfried Truemper for translating this mini-HOWTO. 5. Appendix The modified shell-script ${JWS_HOME}/intel-S2/bin/jws is listed below. ---8<-----8<--- cut here ---8<-----8<---- #!/bin/sh # /usr/local/lib/JWS/intel-S2/bin/jws # # @(#)jws 1.64 96/05/02 # # Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software # and its documentation for NON-COMMERCIAL purposes and without # fee is hereby granted provided that this copyright notice # appears in all copies. Please refer to the file "copyright.html" # for further important copyright and licensing information. # # SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF # THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED # TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A # PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR # ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR # DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. # # edit by Mike Gaertner 15.08.1996 mg@genyosha.in-chemnitz.de # # java JDK bin, home # edit this !! # _SS_JWS_HOME=${JAVA_HOME} _SS_JDK_HOME=$_SS_JWS_HOME # RUNCLASSPATH="$_SS_JWS_HOME/lib/classes.zip:$_SS_JWS_HOME/lib/classes" # NCLASSPATH="$_SS_JWS_HOME/lib/classes" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${JAVA_HOME}/lib/`arch`" export LD_LIBRARY_PATH # # Determine JWS_HOME # if [ -z "$JWS_HOME" ] ; then _SS_JWS_HOME=`dirname $0` _SS_JWS_HOME=`cd $_SS_JWS_HOME/../.. ; pwd` fi if [ ! -d "$_SS_JWS_HOME" ] ; then echo "Invalid _SS_JWS_HOME: $_SS_JWS_HOME" 1>&2 exit 1 fi if [ ! -r "$_SS_JWS_HOME/lib/properties" ] ; then echo "Invalid _SS_JWS_HOME: $_SS_JWS_HOME/lib/properties" 1>&2 exit 1 fi if [ ! "${_SS_JWS_HOME}" ] then if [ ${_SS_JDK_HOME} ] then _SS_JWS_HOME=${_SS_JDK_HOME} else _SS_JWS_HOME=$_SS_JWS_HOME/${VARIANT} fi else # could be either an install JWS dir or JDK bin if [ -d ${_SS_JWS_HOME}/build ] then _SS_JWS_HOME=${_SS_JWS_HOME}/build elif [ -d ${_SS_JWS_HOME}/${VARIANT} ] then _SS_JWS_HOME=${_SS_JWS_HOME}/${VARIANT} fi fi # needs to be exported, because it is referenced by JWS builder export _SS_JWS_HOME # assert: _SS_JWS_HOME points to the parent of lib if [ ! -d ${_SS_JWS_HOME}/bin ] then echo " By convention, _SS_JWS_HOME must have a bin subdirectory" echo " _SS_JWS_HOME: ${_SS_JWS_HOME}" echo " ${_SS_JWS_HOME}/bin does not exits" exit fi if [ ! "${_SS_JDK_HOME}" ] then _SS_JDK_HOME=$_SS_JWS_HOME/../JDK else if [ -d ${_SS_JDK_HOME}/build ] then export _SS_JDK_HOME=${_SS_JDK_HOME}/build fi fi # assert: _SS_JDK_HOME points to the parent of classes if [ ! -d ${_SS_JDK_HOME}/lib/classes ] then echo " By convention, _SS_JDK_HOME must have a classes subdirectory" echo " _SS_JDK_HOME: ${_SS_JDK_HOME}" echo " ${_SS_JDK_HOME}/lib does not exits" exit fi # assert: _SS_JDK_HOME points to the parent of lib if [ ! -d ${_SS_JDK_HOME}/lib ] then echo " By convention, _SS_JDK_HOME must have a lib subdirectory" echo " _SS_JDK_HOME: ${_SS_JDK_HOME}" echo " ${_SS_JDK_HOME}/lib does not exits" exit fi JAVA_HOME=${_SS_JDK_HOME} export JAVA_HOME if [ `/bin/uname -m` = "i386" ] ; then ARCH='i386' elif [ `/bin/uname -m` = "i486" ] ; then ARCH='i486' elif [ `/bin/uname -m` = "i586" ] ; then ARCH='i586' fi # # Set Paths # # # Create .jws directory # # backwards compatibility if [ -d "$HOME/.jde" ] ; then if [ ! -d "$HOME/.jws" ] ; then echo "Moving $HOME/.jde to $HOME/.jws" mv $HOME/.jde $HOME/.jws fi fi if [ ! -d "$HOME/.jws" ] ; then echo "Creating $HOME/.jws directory" mkdir -p $HOME/.jws fi # # Parse arguments # the -debug option is assumed to have a value associated with it. # transform '-debug ' to '-debug -Djws.startup.props=' prog=java debug_opts=""; opts=""; while [ $# -ne 0 ]; do case "$1" in -debug) prog=java_g; debug_opts="-debug"; debug_prop="-Ddebug.browser=yes" ;; -*) opts="$opts $1" ;; *) args="$args $1" ;; esac shift; done # # Select a java interpreter # if [ -x "${_SS_JWS_HOME}/bin/$prog" ] ; then JAVA="${_SS_JWS_HOME}/bin/$prog" else JAVA=$prog fi # # Add WWW_HOME option # if [ ! -z "$WWW_HOME" ] ; then opts="$opts -Dwww.home=$WWW_HOME" fi JWSLOG=${JWSLOG:-$HOME/.jws/weblog} export JWSLOG exec $JAVA $debug_opts -classpath $RUNCLASSPATH \ -Djws.home=$_SS_JWS_HOME -Dhotjava.home=$_SS_JWS_HOME \ -Djws.bin=$JWS_BIN -Djdk.bin=${_SS_JWS_HOME}/bin \ -Djws.ut.user=$USER "-Djws.ut.platform=\"`uname -srm`\"" \ -Djws.build.classes=$NCLASSPATH $debug_prop $opts sun.jws.Main $args ---8<-----8<--- cut here ---8<-----8<----