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
PATH=${PATH}:${JAVA_HOME}/bin:so-on

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.