Hot answers tagged


You have to worry about more than just $JAVA_HOME; you also need to set $PATH if you are going to call the commands without an absolute path. ie java and not /opt/java/1.7/bin/java. Now depending on how your script works or how you call java, you have a few options. Bash Script Doing it this way means you do not need to add an extra user #!/bin/bash ...


The guide that you presented tells you how to set these variables globally - for all users. Since you only want to set these for yourself, you should put them in ~/.bashrc EDIT: As Gilles pointed out in the comment below, .bashrc is intended for interactive settings, and few things can go wrong under some circumstances. Instead, you should put them in ....


Eclipse now requires Java 8 and you're using Java 1.7, this won't work. Install jdk8-openjdk instead and/or wait for the bug in Arch Linux' bug tracker to be fixed.


Requires: java Should do almost what you need. At least on RHEL/CentOS all Java packages habe a Provides: java and that will be pulled in with the above Requires. However you will get the latest Java if none is installed, not the default one. If one is already installed the dependency is already fulfilled and nothing happens.

Only top voted, non community-wiki answers of a minimum length are eligible