Menu

MAC INSTALL staf , java_home can't change

Help
hanson
2016-04-12
2016-04-13
  • hanson

    hanson - 2016-04-12

    I install staf on MAC OS 10.11.1, the staf java_home always

    "INSTALLER_JAVA_DOT_HOME=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
    I hava already set the JAVA_HOME in /etc/profile, but it doesn't work
    HOW CAN I CHANGE THE JAVA_HOME ?

     
  • Sharon Lucas

    Sharon Lucas - 2016-04-12

    Environment variables for STAF must be set in the environment in which STAFProc is run. Before you start STAFProc, check that your PATH environment variable contains a path to the Java that you want to use. For example:

    # echo $PATH
    /Library/staf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    
    # which java
    /usr/bin/java
    
    # java -version
    java version "1.8.0_51"
    Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
    Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
    
    # cd /Library/staf
    # ./startSTAFProc.sh
    # appending output to nohup.out
    
    # tail nohup.out
    
    Machine          : staf4f.austin.ibm.com
    Machine nickname : staf4f.austin.ibm.com
    Startup time     : 20160412-09:34:32
    
    STAFProc version 3.4.24.1 initialized
    
    # STAF local VAR RESOLVE STRING "{STAF/Env/PATH}"
    Response
    --------
    /Library/staf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    
    # java -version
    java version "1.8.0_51"
    Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
    Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
    
    # STAF local PROCESS START SHELL COMMAND "java -version" RETURNSTDOUT STDERRTOSTDOUT WAIT
    Response
    --------
    {
      Return Code: 0
      Key        : <None>
      Files      : [
        {
          Return Code: 0
          Data       : java version "1.8.0_51"
    Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
    Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
    
        }
      ]
    }
    #
    
     
    • hanson

      hanson - 2016-04-12

      Thanks, the java is that i want to use. But I encountered another problem. I use the script ./startSTAFProc.sh. In nohup.out , it shows the error message

      dyld: Library not loaded: /opt/dev/autobuild/build/rel/macosx/staf/retail/lib/libSTAF.dylib

      so, i can only start the STAF by

      cd /STAF/bin && ./STAFProc &

      My STAF version is "STAFProc version 3.4.24 initialized" and I use "STAF3424-setup-macosx-universal.zip" install on my MAC OS

       
  • hanson

    hanson - 2016-04-12

    Thanks, the java is that i want to use. But I encountered another problem. I use the script ./startSTAFProc.sh. In nohup.out , it shows the error message

    dyld: Library not loaded: /opt/dev/autobuild/build/rel/macosx/staf/retail/lib/libSTAF.dylib

    so, i can only start the STAF by

    cd /STAF/bin && ./STAFProc &
    My STAF version is "STAFProc version 3.4.24 initialized" and I use "STAF3424-setup-macosx-universal.zip" install on my MAC OS

     
  • Sharon Lucas

    Sharon Lucas - 2016-04-12

    That error is because you don't have the STAF environment variables set (e.g. for PATH, DYLD_LIBRARY_PATH, etc). Did you select all the defaults when installing STAF? You probably should choose the default "System" for the "Update Environment/Menus" option during the install, as this will update the System environment variables for STAF (though you'll have to open a new terminal after the install or reboot to pick up the environment variable updates for the system).

    Otherwise, you need to source STAFEnv.sh first which will set the environment variables needed for STAF. Try the following:

    cd /Library/staf      (assuming this is where you installed STAF)
    . ./STAFEnv.sh
    ./startSTAFProc
    
     
    • hanson

      hanson - 2016-04-12

      I did set the STAF environment variables and select the default "System" for the "Update Environment/Menus". I reboot , it doesn't work. The /etc/profile is :

      22 PATH="/Library/staf/bin:${PATH}"
      23 export PATH

      29 STAFCONVDIR=/Library/staf/codepage
      30 export STAFCONVDIR

      36 DYLD_LIBRARY_PATH="/Library/staf/lib:${DYLD_LIBRARY_PATH}"
      37 export DYLD_LIBRARY_PATH

      44 CLASSPATH="$/Library/staf/lib/JSTAF.jar:${CLASSPATH}"
      45 export CLASSPATH

       
  • STAF Automated Build

    What directory did you install STAF in? In your posting on your other thread, your PATH contained /Users/pandazhao/Documents/staf. But here you're showing that the STAF environment variables are referring to /Library/staf.

    Does the following work?

    cd /Library/staf
    . ./STAFEnv.sh
    ./startSTAFProc
    
     
    • hanson

      hanson - 2016-04-13

      I installed STAF BY “ root” and user “pandazhao”, so there are two STAF(install in /Library/staf and /Users/pandazhao/Documents/staf ) in my PATH。
      And the two environments for "root" and "pandazhao" are both setted.

      The commands didn't work, both the ROOT and "pandazhao" .

       

Log in to post a comment.