Forum Discussion

Pavoletto's avatar
Pavoletto
New Contributor
9 years ago
Solved

Specify Java installation on mockservicerunner.sh

Hi everyone,

 

I have two java installation (jdk6 and jdk7) in a linux environment, with "$PATH" variable pointing to jdk 6 installation.

I don't have the credentials to change the "$PATH" variable value.

 

Is there any way to specify java version launching mockservicerunner.sh? Is it possible to specify java version inside the  script (like the SOAPUI_HOME for example) ?

Thanks in advance,

Paolo

  • I believe that, any user can use his own required path. How is it different in your case?
    You can just use below commands to change, when you login to your session. Note that, this will be applicable only for that current session. If you want them to be permanent i.e., available all the time on login, then you may set them in $HOME/.profile file

    export JAVA_HOME=/set/it/to/jdk7
    export PATH=$JAVA_HOME/bin:$PATH

    You are done.

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    I believe that, any user can use his own required path. How is it different in your case?
    You can just use below commands to change, when you login to your session. Note that, this will be applicable only for that current session. If you want them to be permanent i.e., available all the time on login, then you may set them in $HOME/.profile file

    export JAVA_HOME=/set/it/to/jdk7
    export PATH=$JAVA_HOME/bin:$PATH

    You are done.

    • Pavoletto's avatar
      Pavoletto
      New Contributor

      if I run the command

      export PATH=$JAVA_HOME/bin:$PATH

      I obtain the following value for the PATH variable:

      /opt/java/jdk1.7.0_79/bin:/opt/java/jdk1.6.0_33/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/opt/EnterprisePlatform-5.1.2/jboss-eap-5.1/jboss-as/bin:/home/paolo/bin

      With 2 java path set into PATH variable.
      Is this correct?

    • Pavoletto's avatar
      Pavoletto
      New Contributor

      I've tried setting:

      export JAVA_HOME=/home/paolo/java/jdk1.7.0_79
      export PATH=$JAVA_HOME/bin:$PATH

      in .bash_profile file, And it works perfectly!

      Thank you very much!