Java: question about bash variables and/or enviromental variables

Hello Experts,

I am a linux box

I have my environment variables set as:
JAVA_HOME=/usr/lib/java-1.6.0/jdk1.6.0_24
PATH=/usr/lib/java-1.6.0/jdk1.6.0_24

In my bash file I want to point to the java executable, which is the correct way to set it?

#!/bin/sh
JAVACMD=java

OR

#!/bin/sh
JAVACMD=JAVA_HOME

?

thanks Experts...
epifanio67Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
mustaccioConnect With a Mentor Commented:
Neither, I think. More like

#!/bin/sh
JAVACMD=${JAVA_HOME}/bin/java
0
 
epifanio67Author Commented:
thank you expert...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.