I've spent a few days googling and playing around with this myself but I can't seem to figure it out. I am currently running ubuntu 14. When I open up a terminal and type java it appears that everything is installed correctly. As soon as I navigate to another directory and try the java command I get this error: "java: command not found".
The same happens with gradle. I was trying to use gradle to build a project but once I navigate to the project folder my computer acts like gradle/java is no longer in the command line.
I am using a zsh shell and have placed the Environment Variables in my ~/.zshrc. I have read 10+ tutorials on how to install java and add to the path. Everything seems to work fine when I'm in the home directory. Its after I leave it that the problem happens.
Any help would be great. Thanks!
EDIT: This isn't a duplicate of How to set Java environment path in Ubuntu. If you read the question I have already followed the tutorials and how to do this. I did verbatim what was in that ticket linking this as a duplicate. I asked one of my ubuntu friends and he said it could be the alternatives path? Does anyone know anything about that?