Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to install Glassfish v3.1.2 on Ubuntu 10.04 by obtaining corresponding .sh from Oracle website and running sudo ./glassfish-installer-file.sh. However following error appears:

Could not locate a suitable jar utility. Please ensure that you have Java 6 or newer installed on your system and accessible in your PATH or by setting JAVA_HOME

The problem is that $JAVA_HOME (and also $JDK_HOME which I think is superfluous) is being correctly set in ~/.bashrc file:

export JAVA_HOME=/usr/lib/jvm/java
export JDK_HOME=/usr/lib/jvm/java

and it's possible to execute all programs from $JAVA_HOME/bin directory from console (including jar program).

Now, what I noticed is that some time ago I installed java, javac and javaws specifically using sudo update-alternatives --install ... command into /usr/lib/bin folder.

So I tried to install jar in the same way (using sudo update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_35/bin/jar" 1) and the initial problem was solved - above error didn't appear when I tried to install Glassfish again. But another problem appeared - it looks like during installation GF installer couldn't find keytool program this time.

I'm not very happy with installing several dozens of programs from Java bin folder, so the main question is: is there significant difference from the point of view of other programs (like Glassfish installer) between:

  • installing some program using sudo update-alternatives --install /usr/bin/program-name program-name /path/to/program-name 1 and
  • simply adding it to $PATH variable?

Or this can be considered as bug in Glassfish installer?

Thanks in advance

share|improve this question

closed as off-topic by Eric Carvalho, KasiyA, mikewhatever, Seth Oct 11 '14 at 14:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – Seth
If this question can be reworded to fit the rules in the help center, please edit the question.

see askubuntu.com/a/61513/45156 for correct answer. duplicate q? –  Thufir Oct 10 '14 at 5:52
possible duplicate of How to I install Glassfish on Ubuntu from the command line? –  Thufir Oct 10 '14 at 5:52

1 Answer 1

Glassfish is a complex beast and there's a WHOLE lot more to getting it running than just glassfish itself. Tutorial here: http://www.nabisoft.com/tutorials/glassfish/installing-glassfish-311-on-ubuntu

You'll need to knock out a lot of prerequisites - including an Oracle-specific Java - before you can run the glassfish installer itself.

share|improve this answer
Ok, thanks for pointing out - will try that when I have time –  Yura Nov 27 '12 at 8:02

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