Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Ubuntu + NetBeans + JDK Error

  1. #1
    Join Date
    Jan 2013
    Beans
    14

    Ubuntu + NetBeans + JDK Error

    Hey Guys I installed netbeans and when starting a java project its giving me error of JDK.

    Can someone help me with the same?

    Thanks

  2. #2
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Ubuntu + NetBeans + JDK Error

    First make sure you really have JDK installed on your system, by typing the following in a terminal:
    Code:
    dpkg --list | grep -i jdk
    If you already have it, what should be expected since you installed Netbeans, then probably you haven't set it in the Java Platform Manager in Netbeans. In order to do it just open Netbeans and navigate to Tools -> Java Platforms -> Add Platform... button and specify the path to your JDK folder.

  3. #3
    Join Date
    Jan 2013
    Beans
    14

    Re: Ubuntu + NetBeans + JDK Error

    ii icedtea-6-jre-cacao:i386 6b24-1.11.5-0ubuntu1~12.10.1 i386 Alternative JVM for OpenJDK, using Cacao
    ii icedtea-6-jre-jamvm:i386 6b24-1.11.5-0ubuntu1~12.10.1 i386 Alternative JVM for OpenJDK, using JamVM
    ii icedtea-7-jre-jamvm:i386 7u9-2.3.3-0ubuntu1~12.10.1 i386 Alternative JVM for OpenJDK, using JamVM
    ii openjdk-6-jre:i386 6b24-1.11.5-0ubuntu1~12.10.1 i386 OpenJDK Java runtime, using Hotspot JIT
    ii openjdk-6-jre-headless:i386 6b24-1.11.5-0ubuntu1~12.10.1 i386 OpenJDK Java runtime, using Hotspot JIT (headless)
    ii openjdk-6-jre-lib 6b24-1.11.5-0ubuntu1~12.10.1 all OpenJDK Java runtime (architecture independent libraries)
    ii openjdk-7-jre:i386 7u9-2.3.3-0ubuntu1~12.10.1 i386 OpenJDK Java runtime, using Hotspot JIT
    ii openjdk-7-jre-headless:i386 7u9-2.3.3-0ubuntu1~12.10.1 i386 OpenJDK Java runtime, using Hotspot JIT (headless)
    ii openjdk-7-jre-lib 7u9-2.3.3-0ubuntu1~12.10.1 all OpenJDK Java runtime (architecture independent libraries)

  4. #4
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Ubuntu + NetBeans + JDK Error

    Now that you have a confirmation for JDK, you just have to point the Java Platform in Netbeans to your openJDK location like I posted previously.

    If you don't know its location (/usr/lib/jvm/ usually) just type at a terminal window:
    Code:
    whereis java

  5. #5
    Join Date
    Jan 2013
    Beans
    14

    Re: Ubuntu + NetBeans + JDK Error

    java: /usr/bin/java /usr/bin/X11/java /usr/share/java /usr/share/man/man1/java.1.gz



    Also do I have to uninstall openJDK?

  6. #6
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Ubuntu + NetBeans + JDK Error

    Quote Originally Posted by coolbud012 View Post
    java: /usr/bin/java /usr/bin/X11/java /usr/share/java /usr/share/man/man1/java.1.gz
    By the looks of it your JDK location is at /usr/lib/jvm/ that's the location you have to add to Java Platforms in your Netbeans.

    Quote Originally Posted by coolbud012 View Post
    Also do I have to uninstall openJDK?
    No, if you uninstall it you won't be able to develop in Java since it's the JDK that contains the collection of the Java programming tools.

  7. #7
    Join Date
    Jan 2013
    Beans
    14

    Re: Ubuntu + NetBeans + JDK Error

    How to set it in netbeans I'm not getting any option to set it in NB 7.2.1

  8. #8
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Ubuntu + NetBeans + JDK Error

    Open Netbeans and navigate to Tools -> Java Platforms, click the Add Platform... button and specify the path to your JDK folder.

    Another way is to edit the netbeans.conf file and change 'netbeans_jdkhome=' value according to your JDK location. Something like this:
    Code:
    netbeans_jdkhome="path/to/your/JDK/location"

  9. #9
    Join Date
    Jan 2013
    Beans
    14

    Re: Ubuntu + NetBeans + JDK Error

    There is no option for Java Platforms in tools, there is just Tools --> Options/ Plugins .

    And how to edit the file?

  10. #10
    Join Date
    Jan 2013
    Beans
    14

    Re: Ubuntu + NetBeans + JDK Error

    Quote Originally Posted by slickymaster View Post
    Another way is to edit the netbeans.conf file and change 'netbeans_jdkhome=' value according to your JDK location. Something like this:
    Code:
    netbeans_jdkhome="path/to/your/JDK/location"
    This is my current path in my config file :

    Code:
    netbeans_jdkhome="/usr/lib/jvm/java-6-openjdk-i386"
    its of openjdk, so what exactly I have to do?

    when I am changing it to :

    Code:
    netbeans_jdkhome="/usr/lib/jvm/"
    Netbeans not opening then.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •