[SOLVED] ./jconsole.sh JAVA_HOME is not set. jboss

jboss_logo2

 

How to fix java_home not found but if you thinking about correct setting path because you put export on .bashrc., let’s follow me.

1. remove all java if you have old version.

sudo apt-get update
apt-cache search java | awk '{print($1)}' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e 'java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove

2. purge config file

dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge

3. Remove Java config and cache directory

bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf

4. after all download new version java sdk on oracle.com
5. extract download jdk-7u51-linux-x64.tar.gz to /usr/lib/jvm/ folder
6. after finish setting updates-alternatives
install first

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_51/bin/javac" 1
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_51/bin/java" 1
sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.7.0_51/jre/lib/amd64/libnpjp2.so" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_51/bin/javaws" 1

and the second setting update-alternatives config

sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config mozilla-javaplugin.so
sudo update-alternatives --config javaws

7. and the last you put your export java_home in ./bashrc

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_51/

ok, let’s try again your jconsole.sh to monitoring jboss

thanks for read🙂

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s