0

I would like to install the tool, Class Dependency Analyser tool. I downloaded the software, which is a zip file. I did unzip. It contains a .sh file called cda.sh. When i tried to install it, i got an error that JAVA_HOME is not found. Java is installed in the location /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home. How to edit the cda.sh file to include the JAVA_HOME?

cda.sh

CDA_HOME=`dirname $0`
export CDA_HOME 

LCP=$CDA_HOME/config:$CDA_HOME/lib/*:$CDA_HOME/lib/ext/*
export LCP

# For remote control support by DARC add the following to JVM_OPTS
# -Dcom.sun.management.jmxremote.port=4242 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

# For debugging add the following to JVM_OPTS
# -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
xset JVM_OPTS=-Xmx512M
export JVM_OPTS

execCDA() 
{
    export JHOME
    $JHOME/bin/java $JVM_OPTS -cp $LCP org.pf.tools.cda.CDATool $*

}

error1() 
{
    echo ====================================================
    echo Error: JRE_HOME and JAVA_HOME not found !                                         
    echo Set the JRE_HOME or the JAVA_HOME path variable !
    echo ====================================================
}

if [ $JRE_HOME ] ; then 
        JHOME=$JRE_HOME
        execCDA $*
    elif [ $JAVA_HOME ] ; then
    JHOME=$JAVA_HOME
        execCDA $*
else
        error1
fi
Bright Varghese
  • 103
  • 1
  • 2
  • 9
  • You don't set path in the sh file, you set it on your system environment variable. Just search for it and please don't post without prior work. – PseudoAj May 15 '16 at 17:13
  • Will u pls tell me, in this .sh file, which line, i have to edit. i tried a lot. but i cud not make it. – Bright Varghese May 15 '16 at 17:14
  • Try this: http://askubuntu.com/questions/175514/how-to-set-java-home-for-java – PseudoAj May 15 '16 at 17:17
  • Thank u. I would like to know that should i edit this .sh file? – Bright Varghese May 15 '16 at 17:22
  • I did edit the file cda.sh. I added the following lines into the same. Its working file. Thank u very much. JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home export JAVA_HOME – Bright Varghese May 24 '16 at 14:59

0 Answers0