Reputation: 99
I desperately need some help in installing Java on my server on GoDaddy. At first, I followed instructions mentioned here: https://www.tecmint.com/install-apache-tomcat-in-centos because installing Tomcat is my actual goal. I downloaded 'jdk-8u101-linux-x64.rpm' and did everything as mentioned in the tutorial. At the end of it, when I try to test using the command java -version
, I get -bash: java: command not found. It didn't work even after logging out and logging in again.
Then I followed instructions as mentioned here: https://in.godaddy.com/help/how-to-install-java-on-ubuntu-12351 and got the same error at the end.
When I try whereis java
, I get /usr/bin/java /usr/local/java /usr/share/java. Is it that there are many Java instances and that's why the command isn't executing?
NOTE: The $PATH(/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/usr/local/java/jre1.8.0_25/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin) does include the bin folder of jre.
Any help would be greatly appreciated. Thanks in advance :)
Upvotes: 0
Views: 649
Reputation: 99
Turns out my Java was installed at a different location completely and that wasn't included in the path. This tutorial(https://www.tecmint.com/install-apache-tomcat-in-centos) explains everything in detail except it missed out the point to add Java to the path.
Added that to the path and it's working perfectly since then. Thanks for your help guys :)
Upvotes: 1
Reputation: 8783
I suggest you debug your problem by step by step (Do not follow any step without having success in all the steps before):
/usr/local/java/jre1.8.0_25
. Right?Upvotes: 0