Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have downloaded and ran the self extracting jre bin file. The instillation folder in my subdirectory. Within that same subdirectory I type java - version but to no avail, I'm greeted with this message -bash: java: command not found which indicates that java has not been installed. What other steps do I need to take to get java working?

I found this on a site, but I'm not sure which file to launch or how to do it:

The java executable you need to launch is located in a subfolder, called 'bin'. This way of installation will not configure a default 'java' command for you: you must do this manually or always include the full path in your startup script.

share|improve this question
up vote 2 down vote accepted

Add the path to where you installed it to your standard path. Probably will help a little later to ensure the JAVA_HOME variable is set.

share|improve this answer
I'm new to the whole server scene, how do I do this? – Derek Nov 11 '11 at 18:42
Also bash and similar shells expect binaries run from the current working directory to be run as ./mybinary. The . tells the shell "current working directory" – Tim Nov 11 '11 at 18:43
Assuming your home directory is "/home/Deza" and that you installed it in a subfolder named "javabin", you would add something to either /etc/profile or /home/Deza/.profile that looks like this: export PATH=/home/Deza/javabin:$PATH – Tim Nov 11 '11 at 18:45
Thanks, I managed to launch it, but now I'm getting this error: Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. – Derek Nov 11 '11 at 18:46
Also if the java executable is in that assumed directory: /home/Deza/javabin/ you can run it like this /home/Deza/javabin/java -version – Tim Nov 11 '11 at 18:46

You can't run a binary file that's not in your $PATH by using a relative reference to the file. If you're inside of the directory that your java is in, try ./java -version. the ./ tells the shell to execute the binary that's located in your current working directory and not one in $PATH

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.