home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / DOC / HOWTO / MINI / JAVA_WOR < prev    next >
Encoding:
Text File  |  1996-08-25  |  8.2 KB  |  290 lines

  1.   JWS for LinuX
  2.   Mike Gaertner <mg@genyosha.in-chemnitz.de>
  3.   Version 1.1-en 15.08.1996
  4.  
  5.   Using Java WorkShop (JWS) for Solaris/intel on Linux
  6.  
  7.   1.  Preface
  8.  
  9.   In the past few months many PC-magazines have articles about java and
  10.   ship with a CD containing applets and demo-programs for java. On some
  11.   CDs you can find a beta-version of the "Java Workshop", JWS is a
  12.   Develop Kit, (writing in Java) for Java, whit a Editor, Debuger and
  13.   Portofolie/Project-Manager.
  14.  
  15.   In spite of the platform-independence of Java, there are no
  16.   instructions on how to install this JWS under Linux. Only WinNT,
  17.   Windows95, SunSolaris Sparc or SunSolars Intel are mentioned in the
  18.   documentation coming with the CDs.
  19.  
  20.   As I didn't found any description on this on the net, I did it myself
  21.   and wrote this mini-HOWTO.
  22.  
  23.   2.  Requisites
  24.  
  25.   Please read the Java-HOWTO for general information about Java under
  26.   Linux and how to install the nesassary JDK. For the rest of the mini-
  27.   HOWTO it is assumed that you have
  28.  
  29.   1. the JDK version 1.0 (or better) installed
  30.  
  31.   2. X11R6 (e.g. XFree86 3.1.2 or higher)
  32.  
  33.   3. a CD with JWS in your CD-drive.
  34.  
  35.   3.  Installation
  36.  
  37.   First you have to decide where to install the JWS. As JWS is not part
  38.   of a distribution, it may be a good idea to install it in the
  39.   "/usr/local"-hierarchy.
  40.  
  41.   Set environment-variable "JWS_HOME" to point to the directory of your
  42.   choice and set it permanently in the startup-file of you shell.
  43.  
  44.   For example if you use "bash", the startup-files are "/etc/profile" or
  45.   " /.bash_profile" and the necessary entries would be
  46.  
  47.   export JWS_HOME="/usr/local/JWS"
  48.   export JAVA_HOME="/usr/local/lib/java"
  49.  
  50.   The second entry points to the directory where java is installed on
  51.   your system. If it is not already set, add it to the startup-file,
  52.   too.
  53.  
  54.   On most CDs relating to java you can find the JWS in a sub-directory
  55.   named workshop. Look for the file inteltar.z which is the version of
  56.   the JWS for SunSolars/i386.
  57.  
  58.   This file is a compressed archive which can be unpacked with
  59.  
  60.   tar  -xvzf inteltar.z  -C ${JWS_HOME}
  61.  
  62.   After you have issued this command, you will find the following sub-
  63.   directories in ${JWS_HOME}:
  64.  
  65.   classes, examples, intel-S2, lib, solaris
  66.  
  67.   The commands shown below will delete superfluous files from the
  68.   freshly unpacked JWS and create the necessary links to the already
  69.   installed java-binaries. You can use them verbatim (e.g. via cut&paste
  70.   on the command-line).
  71.  
  72.   ln  -s ${JWS_HOME}/classes  ${JAVA_HOME}/lib/classes
  73.   rm  ${JWS_HOME}/intel-S2/bin/i386/*
  74.   rmdir ${JWS_HOME}/intel-S2/bin/i386
  75.   ln -s ${JAVA_HOME}/bin/i586 ${JWS_HOME}/intel-S2/bin/i586
  76.   ln -s ${JAVA_HOME}/bin/i486 ${JWS_HOME}/intel-S2/bin/i486
  77.   ln -s ${JAVA_HOME}/bin/i386 ${JWS_HOME}/intel-S2/bin/i386
  78.  
  79.   The shell-script for starting JWS is ${JWS_HOME}/intel-S2/bin/jws.
  80.   Because I modified it heavily, it's appended at the end of this mini-
  81.   HOWTO.
  82.  
  83.   Furthermore you have to change line 8 in ${JWS_HOME}/solaris/bin/javac
  84.   so it reads:
  85.  
  86.   if [ -x ${_SS_JDK_BIN}/bin/`/bin/uname -m`/javac ]
  87.  
  88.   Hey, you are already done! End of the show.
  89.  
  90.   Only a last hint: if you create a new project with the JWS you must
  91.   add ${JAVA_HOME}/lib/classes.zip to the environment-varibable
  92.   "CLASSPATH".
  93.  
  94.   4.  Acknowledgements
  95.  
  96.   Thanks to Winfried Truemper <truemper@ElFi.MI.Uni-Koeln.DE> for
  97.   translating this mini-HOWTO.
  98.  
  99.   5.  Appendix
  100.  
  101.   The modified shell-script ${JWS_HOME}/intel-S2/bin/jws is listed
  102.   below.
  103.  
  104.   ---8<-----8<--- cut here ---8<-----8<----
  105.   #!/bin/sh
  106.   # /usr/local/lib/JWS/intel-S2/bin/jws
  107.   #
  108.   # @(#)jws       1.64 96/05/02
  109.   #
  110.   # Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved.
  111.   #
  112.   # Permission to use, copy, modify, and distribute this software
  113.   # and its documentation for NON-COMMERCIAL purposes and without
  114.   # fee is hereby granted provided that this copyright notice
  115.   # appears in all copies. Please refer to the file "copyright.html"
  116.   # for further important copyright and licensing information.
  117.   #
  118.   # SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  119.   # THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  120.   # TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  121.   # PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  122.   # ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  123.   # DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  124.   #
  125.   # edit by Mike Gaertner 15.08.1996 mg@genyosha.in-chemnitz.de
  126.   #
  127.   # java JDK bin, home
  128.   # edit this !!
  129.   #
  130.   _SS_JWS_HOME=${JAVA_HOME}
  131.   _SS_JDK_HOME=$_SS_JWS_HOME
  132.   #
  133.   RUNCLASSPATH="$_SS_JWS_HOME/lib/classes.zip:$_SS_JWS_HOME/lib/classes"
  134.   #
  135.   NCLASSPATH="$_SS_JWS_HOME/lib/classes"
  136.   LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${JAVA_HOME}/lib/`arch`"
  137.   export LD_LIBRARY_PATH
  138.   #
  139.   # Determine JWS_HOME
  140.   #
  141.  
  142.   if [ -z "$JWS_HOME" ] ; then
  143.       _SS_JWS_HOME=`dirname $0`
  144.       _SS_JWS_HOME=`cd $_SS_JWS_HOME/../.. ; pwd`
  145.   fi
  146.  
  147.   if [ ! -d "$_SS_JWS_HOME" ] ; then
  148.       echo "Invalid _SS_JWS_HOME: $_SS_JWS_HOME" 1>&2
  149.       exit 1
  150.   fi
  151.  
  152.   if [ ! -r "$_SS_JWS_HOME/lib/properties" ] ; then
  153.       echo "Invalid _SS_JWS_HOME: $_SS_JWS_HOME/lib/properties" 1>&2
  154.       exit 1
  155.   fi
  156.  
  157.   if [ ! "${_SS_JWS_HOME}" ]
  158.   then
  159.     if [ ${_SS_JDK_HOME} ]
  160.     then
  161.       _SS_JWS_HOME=${_SS_JDK_HOME}
  162.     else
  163.       _SS_JWS_HOME=$_SS_JWS_HOME/${VARIANT}
  164.     fi
  165.   else
  166.     # could be either an install JWS dir or JDK bin
  167.     if [ -d ${_SS_JWS_HOME}/build ]
  168.     then
  169.       _SS_JWS_HOME=${_SS_JWS_HOME}/build
  170.     elif [ -d ${_SS_JWS_HOME}/${VARIANT} ]
  171.     then
  172.       _SS_JWS_HOME=${_SS_JWS_HOME}/${VARIANT}
  173.     fi
  174.   fi
  175.  
  176.   # needs to be exported, because it is referenced by JWS builder
  177.   export  _SS_JWS_HOME
  178.  
  179.   # assert: _SS_JWS_HOME points to the parent of lib
  180.   if [ ! -d ${_SS_JWS_HOME}/bin ]
  181.   then
  182.     echo " By convention, _SS_JWS_HOME must have a bin subdirectory"
  183.     echo " _SS_JWS_HOME:  ${_SS_JWS_HOME}"
  184.     echo " ${_SS_JWS_HOME}/bin does not exits"
  185.     exit
  186.   fi
  187.  
  188.   if [ ! "${_SS_JDK_HOME}" ]
  189.   then
  190.     _SS_JDK_HOME=$_SS_JWS_HOME/../JDK
  191.   else
  192.     if [ -d ${_SS_JDK_HOME}/build  ]
  193.     then
  194.       export _SS_JDK_HOME=${_SS_JDK_HOME}/build
  195.     fi
  196.   fi
  197.  
  198.   # assert: _SS_JDK_HOME points to the parent of classes
  199.   if [ ! -d ${_SS_JDK_HOME}/lib/classes ]
  200.   then
  201.     echo " By convention, _SS_JDK_HOME must have a classes subdirectory"
  202.     echo " _SS_JDK_HOME:  ${_SS_JDK_HOME}"
  203.     echo " ${_SS_JDK_HOME}/lib does not exits"
  204.     exit
  205.   fi
  206.  
  207.   # assert: _SS_JDK_HOME points to the parent of lib
  208.   if [ ! -d ${_SS_JDK_HOME}/lib ]
  209.   then
  210.     echo " By convention, _SS_JDK_HOME must have a lib subdirectory"
  211.     echo " _SS_JDK_HOME:  ${_SS_JDK_HOME}"
  212.     echo " ${_SS_JDK_HOME}/lib does not exits"
  213.     exit
  214.   fi
  215.  
  216.   JAVA_HOME=${_SS_JDK_HOME}
  217.   export JAVA_HOME
  218.  
  219.   if [ `/bin/uname -m` = "i386" ] ; then
  220.     ARCH='i386'
  221.   elif [  `/bin/uname -m` = "i486" ] ; then
  222.     ARCH='i486'
  223.   elif [  `/bin/uname -m` = "i586" ] ; then
  224.     ARCH='i586'
  225.   fi
  226.  
  227.   #
  228.   # Set Paths
  229.   #
  230.   #
  231.   # Create .jws directory
  232.   #
  233.  
  234.   # backwards compatibility
  235.   if [ -d "$HOME/.jde" ] ; then
  236.       if [ ! -d "$HOME/.jws" ] ; then
  237.           echo "Moving $HOME/.jde to $HOME/.jws"
  238.           mv $HOME/.jde $HOME/.jws
  239.       fi
  240.   fi
  241.   if [ ! -d "$HOME/.jws" ] ; then
  242.       echo "Creating $HOME/.jws directory"
  243.       mkdir -p $HOME/.jws
  244.   fi
  245.  
  246.   #
  247.   # Parse arguments
  248.   #  the -debug option is assumed to have a value associated with it.
  249.   #  transform '-debug <file>' to '-debug -Djws.startup.props=<file>'
  250.  
  251.   prog=java
  252.   debug_opts="";
  253.   opts="";
  254.   while [ $# -ne 0 ]; do
  255.      case "$1" in
  256.       -debug) prog=java_g; debug_opts="-debug"; debug_prop="-Ddebug.browser=yes" ;;
  257.       -*) opts="$opts $1" ;;
  258.       *)  args="$args $1" ;;
  259.      esac
  260.      shift;
  261.   done
  262.  
  263.   #
  264.   # Select a java interpreter
  265.   #
  266.  
  267.   if [ -x "${_SS_JWS_HOME}/bin/$prog" ] ; then
  268.       JAVA="${_SS_JWS_HOME}/bin/$prog"
  269.   else
  270.       JAVA=$prog
  271.   fi
  272.  
  273.   #
  274.   # Add WWW_HOME option
  275.   #
  276.   if [ ! -z "$WWW_HOME" ] ; then
  277.       opts="$opts -Dwww.home=$WWW_HOME"
  278.   fi
  279.  
  280.   JWSLOG=${JWSLOG:-$HOME/.jws/weblog}
  281.   export JWSLOG
  282.  
  283.   exec $JAVA $debug_opts -classpath $RUNCLASSPATH \
  284.   -Djws.home=$_SS_JWS_HOME -Dhotjava.home=$_SS_JWS_HOME \
  285.   -Djws.bin=$JWS_BIN -Djdk.bin=${_SS_JWS_HOME}/bin \
  286.   -Djws.ut.user=$USER "-Djws.ut.platform=\"`uname -srm`\"" \
  287.   -Djws.build.classes=$NCLASSPATH $debug_prop $opts sun.jws.Main $args
  288.   ---8<-----8<--- cut here ---8<-----8<----
  289.  
  290.