Help installing on Ubuntu (Simple JDK issue ?)

So here's what I did -

  1. Put the contents of the Oracle JDK into /usr/lib/jvm/jdk1.7.0/
  2. ran these commands:


$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1

$ export JAVA_HOME=/usr/lib/jvm/jdk1.7.0/bin/java

$ echo $JAVA_HOME
/usr/lib/jvm/jdk1.7.0/bin/java

Now here's the problem:
$ sh webstorm.sh
webstorm.sh: 1: eval: /usr/lib/jvm/jdk1.7.0/bin/java: not found

I can see that /usr/lib/jvm/jdk1.7.0/bin/java does appear to exist.

What am I doing wrong?

Thanks

2 comments

Hi there,

I'm not a Linux user so do not take my words for granted .. but if you look at webstorm.sh .. you will see that "/bin/java" will be added to the JDK path automatically. So .. instead of providing full path to java executable you need to provide path to JDK home folder only. Please refer to http://www.jetbrains.com/phpstorm/webhelp/system-requirements-and-installation.html

So try

$ export JAVA_HOME=/usr/lib/jvm/jdk1.7.0

instead of
$ export JAVA_HOME=/usr/lib/jvm/jdk1.7.0/bin/java
0

Well, that wasn't it exactly but thanks anyway.   I finally got it working by re-installing Oracle java using these instructions:
http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

To get the environment variable to work I had to add it to my .bashrc file:

export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre/bin/java

0

Please sign in to leave a comment.