Reputation: 33406
I installed the Java 6 JRE on my VPS just fine, but I can't get the EE SDK installation to even run.
root@vps [/usr/java]# java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode)
However, when I try to run java_ee_sdk-6-unix.sh
:
./ ../ java_ee_sdk-6-unix.sh* jre1.6.0_18/ jre.bin*
root@vps [/usr/java]# ./java_ee_sdk-6-unix.sh
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
But the catch is that I set my environment variables correctly:
root@vps [/usr/java]# echo $PATH
/usr/java/jre1.6.0_18:/usr/java/jre1.6.0_18/bin:/usr/java/jre1.6.0_18/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin
root@vps [/usr/java]# export -p | grep JAVA_HOME
declare -x JAVA_HOME="/usr/java/jre1.6.0_18"
I'm pulling my hair out here, any ideas?
Upvotes: 19
Views: 41924
Reputation: 41
I had the problem, however it was related to the sudo user account when executing the .sh file. I was installing Glassfish v3 on a new VPS hosted server with Ubuntu 10.4 64Bit OS.
sudo chmod +x java_ee_sdk-6u2-jdk-linux-x64.sh
sudo ./java_ee_sdk-6u2-jdk-linux-x64.sh -s -a java_ee_sdk-6u2-jdk-linux-x64-install-answers.txt
Only to get the exact same error you were first experiencing:
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
Silly really, when I ran the command like this:
./java_ee_sdk-6u2-jdk-linux-x64.sh -s -a java_ee_sdk-6u2-jdk-linux-x64-install-answers.txt
To my suprise it responded with:
Welcome to GlassFish V3 installer
Using the user defined JAVA_HOME : /opt/jdk
Entering setup...
This was after I had setup my JAVA_HOME in file: /etc/bash.bashrc
JAVA_HOME=/opt/jdk
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
Upvotes: 3
Reputation: 497
Quick and dirty solution for me:
sudo apt-get install jarwrapper fastjar
Then just run your .sh script and voila!
Upvotes: 4
Reputation: 2699
I got the same error. I removed OpenJDK using apt-get (I'm running Ubuntu 11.10) then downloaded Java JDK 1.7 (which comes of course with JRE) and unpacked this under /usr/local/java - this gave me new directory:
/usr/local/java/jdk1.7.0_04
Next I added:
/usr/local/java/jdk1.7.0_04
to $PATH, set $JAVA_HOME and $JRE_HOME as
/usr/local/java/jdk1.7.0_04
/usr/local/java/jdk1.7.0_04/jre
respectively.
Everything works nice. I can compile java progams using javac and run them using java. Jar program runs fine as well. So why does java ee installer complain about that? Any clues as how to fix that?
Upvotes: 3
Reputation: 31211
Do this:
ln -s /opt/jdk1.6.0_16 /opt/jdk
Edit $HOME/.bashrc
:
JAVA_HOME=/opt/jdk
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
Logout and log back in.
This offers many advantages:
I have done this for years and have never had any problems with Java on Linux, except for packages that do not detect that Java is installed and attempt to install the OpenJDK.
Also, stay away from the OpenJDK as its fonts are terrible to behold.
Upvotes: 7
Reputation: 346
My 2 cents...
I have the same problem and solve it by installing a jar utility.
As "matt b" said the problem was (well my problem), that the installer was not finding a jar utility (jar program), needed to run the installation files.
Do you have a JDK installed? You likely want to put $JDK_HOME/bin on your PATH, not the /bin of a JRE, as jar comes with JDK, not JRE.
But in my case (having Ubuntu 11.10 x64 and JAVA_HOME --> /usr/lib/jvm/java-6-openjdk) the problem was not fixed by setting the JDK/bin dir on the PATH. Instead I had to install a jar utility package (using Synaptic) called Jarwrapper version 0.37ubuntu1.
After installing it, the installation script of Oracle's JDK (java_ee_sdk-6u3-jdk7-linux-x64-ml.sh) ran just fine.
Regards,
Upvotes: 1
Reputation: 11
This info works for me... The first method was enought.
Regards.
http://ubuntuforums.org/showthread.php?p=11485538#post11485538
Upvotes: 1
Reputation: 11
In my case, I had jdk1.6.0_16 extracted in my home directory and had a symbolic links to java
and /javac
in /bin
. Then I encountered the error described above in the question.
However once I included a symbolic link to jar
in /bin
, the shell script to install Java EE ran as expected.
Upvotes: 1
Reputation: 140041
Do you have a JDK installed? You likely want to put $JDK_HOME/bin
on your PATH, not the /bin
of a JRE, as jar
comes with JDK, not JRE.
Upvotes: 15