Announcement Announcement Module
Collapse
No announcement yet.
STS 2.6.0 is not finding JDK Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS 2.6.0 is not finding JDK

    Hi,

    I know this is a basic thing but I am really struggling with this.

    I have installed STS 2.6.0 on Ubuntu 10.04. I have JDK 1.6.0_20 installed. When I try to start STS, I get the error

    A Java Runtime Environment (JRE) or Java Development Kit (JDK)
    must be available in order to run STS. No Java virtual machine
    was found after searching the following locations:
    /{home directory where STS is located}/springsource/sts-2.6.0.RELEASE/jre/bin/java
    java in your current PATH

    I have set up the JAVA_HOME variable and PATH variables in .bashrc as

    export JAVA_HOME={home directory}/jdk1.6.0_20

    export PATH=.:JAVA_HOME/bin:JAVA_HOME/jre/bin:$PATH

    I can see the path when I do echo $PATH.

    Why is it that STS is looking for jre under sts-2.6.0.RELEASE directory? I checked the sts.ini but it has no such directions to look for jre in specific folder.

    I appreciate any help in figuring this out.

    Thanks,
    Jan.

  • #2
    Hi Jan!

    I think Eclipse/STS is looking for an JRE in that location as the default JRE to run with, but it should fall back to the standard locations and environment variables when it cannot find a JRE in that location. Does it work for you if you start STS from the command line while specifying the JDK via the argument "-vm path-to-javaw.exe"?

    HTH,
    Martin

    Comment


    • #3
      Hi,

      if you use the STS installer the -vm option will be explicitly set in the STS.ini to point to the JVM location identified in the install process. If the JVM is later moved (e.g. during a dist-upgrade) this can cause an error and require updating the path in STS.ini that is specified after the -vm option.

      Originally posted by Invincible View Post
      A Java Runtime Environment (JRE) or Java Development Kit (JDK)
      must be available in order to run STS. No Java virtual machine
      was found after searching the following locations:
      /{home directory where STS is located}/springsource/sts-2.6.0.RELEASE/jre/bin/java
      java in your current PATH
      It sounds like you extracted STS from the tar.gz archive though. In this case STS searches its install location and the PATH for a Java excutable.

      Originally posted by Invincible View Post
      I have set up the JAVA_HOME variable and PATH variables in .bashrc as

      export JAVA_HOME={home directory}/jdk1.6.0_20

      export PATH=.:JAVA_HOME/bin:JAVA_HOME/jre/bin:$PATH
      I would expect this instead:

      Code:
      export PATH=.:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
      Can you run "java -version" from the shell to verify that a valid Java executable is on the path (STS ignores $JAVA_HOME) and then try starting STS form the same shell?

      Alternatively, as Martin pointed out, you can explicitly configure a JVM in the STS.ini file by adding the following two lines to the beginning of the file (modify the path to point to a valid JVM on your system):

      Code:
      -vm
      /usr/lib/jvm/java-6-sun-1.6.0.26/bin/java
      HTH,

      Steffen

      Comment


      • #4
        Hi Martin,

        I haven't tried starting STS in the command line. But I did try adding the JDK path to the STS.ini. It did not work.

        Hi Steffen,

        I typed the PATH wrong in my previous message. I had it as $JAVA_HOME only.
        Yes, when I run java -version, the correct java version is displayed.

        Highly appreciate your response.

        Thanks,
        Jan.

        Comment


        • #5
          I got it working when I ran STS from command line. Also, I did a big mistake when I updated the STS.ini file earlier. I copied and pasted the jdk path and it was only until jdk/bin.

          Thanks much and I sincerely appreciate your help.

          Thanks,
          Jan.

          Comment


          • #6
            Hey Jan!

            Glad to hear its now working!!! And thanks for letting us know!!!

            Cheers,
            -Martin

            Comment

            Working...
            X