2 Replies Latest reply on Jun 1, 2004 10:27 AM by lepe

    Im trying to run jboss on linux.

    kelly_kong03

      I downloaded jboss3.2.3. trying to run run.sh under bin folder, but it gave java_home related problem, then i modified run.sh to set up java_home and also put jdk into /usr/java....still gave me problem...anybody can give me a executable run.sh? thanks in advance

      the following is the run.sh i modified
      #!/bin/sh
      ### ====================================================================== ###
      ## ##
      ## JBoss Bootstrap Script ##
      ## ##
      ### ====================================================================== ###

      ### $Id: run.sh,v 1.9.2.3 2003/05/02 00:51:17 slaboure Exp $ ###

      DIRNAME=`dirname $0`
      PROGNAME=`basename $0`
      GREP="grep"

      # Use the maximum available, or set MAX_FD != -1 to use that
      MAX_FD="maximum"

      #
      # Helper to complain.
      #
      warn() {
      echo "${PROGNAME}: $*"
      }

      #
      # Helper to puke.
      #
      die() {
      warn $*
      exit 1
      }

      # OS specific support (must be 'true' or 'false').
      cygwin=false;
      darwin=false;
      case "`uname`" in
      CYGWIN*)
      cygwin=true
      ;;

      Darwin*)
      darwin=true
      ;;
      esac

      # Read an optional running configuration file
      if [ "x$RUN_CONF" = "x" ]; then
      RUN_CONF="$DIRNAME/run.conf"
      fi
      if [ -r $RUN_CONF ]; then
      . $RUN_CONF
      fi

      # For Cygwin, ensure paths are in UNIX format before anything is touched
      if $cygwin ; then
      [ -n "$JBOSS_HOME" ] &&
      JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"`
      [ -n "$JAVA_HOME" ] &&
      JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
      [ -n "$JAVAC_JAR" ] &&
      JAVAC_JAR=`cygpath --unix "$JAVAC_JAR"`
      fi

      # Setup JBOSS_HOME
      if [ "x$JBOSS_HOME" = "x" ]; then
      # get the full path (without any relative bits)
      JBOSS_HOME=`cd $DIRNAME/..; pwd`
      fi
      export JBOSS_HOME

      # Setup JAVA_HOME
      echo "set up java_home"
      # get the full path (without any relative bits)
      JAVA_HOME=`cd /usr/java/jdk; pwd`
      export JAVA_HOME
      echo "java_home" $JAVA_HOME

      # Increase the maximum file descriptors if we can
      if [ "$cygwin" = "false" ]; then
      MAX_FD_LIMIT=`ulimit -H -n`
      if [ $? -eq 0 ]; then
      if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
      # use the system max
      MAX_FD="$MAX_FD_LIMIT"
      fi

      ulimit -n $MAX_FD
      if [ $? -ne 0 ]; then
      warn "Could not set maximum file descriptor limit: $MAX_FD"
      fi
      else
      warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
      fi
      fi

      # Setup Profiler
      useprofiler=false
      if [ "x$PROFILER" != "x" ]; then
      if [ -r "$PROFILER" ]; then
      . $PROFILER
      useprofiler=true
      else
      die "Profiler file not found: $PROFILER"
      fi
      fi

      # Setup the JVM
      if [ "x$JAVA" = "x" ]; then
      if [ "x$JAVA_HOME" != "x" ]; then
      JAVA="$JAVA_HOME/bin/java"
      else
      JAVA="java"
      fi
      fi

      # Setup the classpath
      runjar="$JBOSS_HOME/bin/run.jar"
      if [ ! -f $runjar ]; then
      die "Missing required file: $runjar"
      fi
      JBOSS_BOOT_CLASSPATH="$runjar"

      # Include the JDK javac compiler for JSP pages. The default is for a Sun JDK
      # compatible distribution which JAVA_HOME points to
      if [ "x$JAVAC_JAR" = "x" ]; then
      JAVAC_JAR="$JAVA_HOME/lib/tools.jar"
      fi
      if [ ! -f "$JAVAC_JAR" ]; then
      # MacOSX does not have a seperate tools.jar
      if [ "$darwin" != "true" ]; then
      warn "Missing file: $JAVAC_JAR"
      warn "Unexpected results may occur. Make sure JAVA_HOME points to a JDK and not a JRE."
      fi
      fi

      if [ "x$JBOSS_CLASSPATH" = "x" ]; then
      JBOSS_CLASSPATH="$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR"
      else
      JBOSS_CLASSPATH="$JBOSS_CLASSPATH:$JBOSS_BOOT_CLASSPATH:$JAVAC_JAR"
      fi

      # If JAVA_OPTS is not set try check for Hotspot
      if [ "x$JAVA_OPTS" = "x" ]; then

      # Check for SUN(tm) JVM w/ HotSpot support
      if [ "x$HAS_HOTSPOT" = "x" ]; then
      HAS_HOTSPOT=`$JAVA -version 2>&1 | $GREP -i HotSpot`
      fi

      # Enable -server if we have Hotspot, unless we can't
      if [ "x$HAS_HOTSPOT" != "x" ]; then
      # MacOS does not support -server flag
      if [ "$darwin" != "true" ]; then
      JAVA_OPTS="-server"
      fi
      fi
      fi

      # Setup JBoss sepecific properties
      JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME"

      # For Cygwin, switch paths to Windows format before running java
      if $cygwin; then
      JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
      JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
      JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"`
      fi

      # Display our environment
      echo "================================================================================"
      echo ""
      echo " JBoss Bootstrap Environment"
      echo ""
      echo " JBOSS_HOME: $JBOSS_HOME"
      echo ""
      echo " JAVA: $JAVA"
      echo ""
      echo " JAVA_OPTS: $JAVA_OPTS"
      echo ""
      echo " CLASSPATH: $JBOSS_CLASSPATH"
      echo ""
      echo "================================================================================"
      echo ""

      if $useprofiler; then
      # Hand over control to profiler
      runProfiler
      else
      STATUS=10
      while [ $STATUS -eq 10 ]
      do
      # Execute the JVM
      echo "java=" $JAVA
      echo "java_opts=" $JAVA_OPTS
      echo "classpath=" $-classpath
      echo "jboss_classpath=" $JBOSS_CLASSPATH
      $JAVA $JAVA_OPTS \
      -classpath "$JBOSS_CLASSPATH" \
      org.jboss.Main "$@"
      STATUS=$?
      # if it doesn't work, you may want to take a look at this:
      # http://developer.java.sun.com/developer/bugParade/bugs/4465334.html
      done
      fi

        • 1. Re: Im trying to run jboss on linux.
          carpy1970

          For a atart, modifying the run.sh script is not the best way to do it. Any time u update to a new version of jboss this file will be overwritten and you will have to remember to update it again. I have a file named java.sh in /etc/profile.d (the files in this director are run for each user when they log in) with the following contents

          export PATH=/usr/java/j2sdk1.4.2_04/bin:$PATH
          export JAVA_HOME=/usr/java/j2sdk1.4.2_04/


          It would be usefull if you pasted the error messages you are getting rather then simply stating that you are getting "a problem"

          • 2. Re: Im trying to run jboss on linux.
            lepe

            or use the file bin/run.conf (at least in 3.2.3)

            /L