Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: JDK won't work

  1. #11
    Join Date
    Apr 2008
    Beans
    118

    Re: JDK won't work

    It might be the case that Eclipse is using an older version of the compiler. To check and possibly change this, go to Project > Properties, and a dialog should come up. On the list on the left, select "Java Compiler", and on the right you should see what version of Java you're using. To change this, click the "Enable Project Specific Settings", and you're good to go.
    Last edited by ceclauson; July 31st, 2008 at 06:58 AM. Reason: fixed spelling

  2. #12
    Join Date
    Apr 2008
    Beans
    79

    Re: JDK won't work

    Thanks. I changed that from 5.0 to 6.0 and restarted eclipse, but I'm getting the same error on import java.util.Scanner. I don't see why it still isn't working.

  3. #13
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: JDK won't work

    2 more things to check.

    1. Make sure that the "JRE System Library" is setup as a library for your project.

    Right click your project "Properties" > "Java build path", libraries lab. You should see "JRE System Library..." if you are setup correctly. If not click "Add library" and add "JRE System Library".

    2. Make sure you haven't overridden your workspace complier settings at the project level.

    Right click your project "Properties" > "Java Compiler", make sure that "Enable project specific settings" is NOT checked.

    Good luck

  4. #14
    Join Date
    Apr 2008
    Beans
    79

    Re: JDK won't work

    Hmm... Both of those seem to be set up correctly... So that brings up two questions. One is the obvious how do I fix it, and two - what could I have done to mess things up this badly.

  5. #15
    Join Date
    Apr 2008
    Beans
    79

    Re: JDK won't work


  6. #16
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: JDK won't work

    Can you post screen shots of the following.

    1. "Windows" > "Preferences" > "Java" > "Installed JREs"

    2. Right click project > "Properties" > "Java Compiler"

    3. Right click project > "Properties" > "Java Build path" > libraries tab.

  7. #17
    Join Date
    Apr 2008
    Beans
    79

    Re: JDK won't work

    Sure.
    Attached Images Attached Images

  8. #18
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: JDK won't work

    You are still using the GNU version of the JDK.

    In “Window” > “Preferences” > “Installed JREs” you need to “Add” the Sun JDK and set it as the default.

    The JDK should be in the "/usr/lib/jvm/" folder.
    Last edited by tinny; August 6th, 2008 at 09:58 PM.

  9. #19
    Join Date
    Apr 2008
    Beans
    79

    Re: JDK won't work

    Thank you so much!!!!

  10. #20
    Join Date
    Aug 2008
    Location
    Lund, Sweden
    Beans
    9

    Re: JDK won't work

    Finally someone with a good answer. Been searching for this answer for ages.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

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
  •