3 Replies Latest reply on May 28, 2012 4:23 AM by Malay Tiwari

    How to set path of JAVA env variable using nsh?



      Can someone please guide me, how can I set JAVA env variable using NSH.


      I think it should be something like


      set %PATH= blah blah..


      Thanks & Regards,


        • 1. How to set path of JAVA env variable using nsh?
          Joshua Skirde

          Hi Malay,


          Are you trying to launch a java application from an NSH? If so, I would create a script to set your CLASSPATH and execute your java code. You'd just call this script via nexec. Obviously your java code would have to run non-graphically.


          eg... from an NSH run the following:


          % cd //myhost/c/temp

          % echo 'set CLASSPATH="%CLASSPATH%;C:\Program Files\myjavaCode"

          cd /d "C:\Program Files\myjavaCode"

          java MyJavaCode' > C:\temp\myjava.bat

          % nexec -e myjava.bat


          Kind regards,


          • 2. How to set path of JAVA env variable using nsh?

            No Joshua,


            While running a nsh job against application server forfollowing BLCLI commands we are getting an error

            "Error   23.5.2012 8:59:58          Failed to open D:/Program Files/BMCSoftware/BladeLogic/8.1/NSH/jre-32/bin/server/jvm.dll: No such file ordirectory"


            Although jvm.dll exist on application server on mentioned location. And following commands run when are executed manually on appserver's nsh prompt.



            blcli_setoption serviceProfileName Production

            blcli_setoption roleName RBACAdmins

            blcli_execute RBACRole syncUsersWindowsServerAdministrators


            So I need to update the PATH env variable current path is

            echo $PATH

            /cygdrive/D/Program Files/BMC Software/BladeLogic/8.1/NSH/bin:/cygdrive/D/Program Files/BMC Software/BladeLogic/8.1/NSH/sbin:/cygdrive/c/Program Files/HP/NCU:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0/:/cygdrive/c/PROGRA~1/BMCSOF~1/Patrol3/bin:/usr/bin:/jre-32/bin




            • 3. How to set path of JAVA env variable using nsh?

              OK I got the solution by myself...


              I just replaced following values in my env variable,


              replace D:\Program Files\BMC Software\BladeLogic\8.1\NSH\jre-32\bin


              "/cygdrive/D/Program Files/BMC Software/BladeLogic/8.1/NSH/jre-32/bin"


              Thanks & Regards