5

For some reason, when I go to add a JRE to eclipse/sts and give it the location of the JDK 1.6.0_22, it says:

Target is not a JDK root. System library was not found.

I am giving it this folder, which is accurate and works for everything else: /opt/jdk1.6.0_22

But it is the jdk root. IDEA thinks so. Every other APP on the planet thinks so too. Aside: God, I really hate eclipse. This is why I never use it, because nothing works like it's supposed to. I just want to try Spring Insight out, so that's why I am using STS...

I am on Ubuntu 10.10 if that makes any difference.

Please help. I think I can finally get this to work if I can just get STS/Eclipse to stop being stupid :/

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
egervari
  • 22,372
  • 32
  • 121
  • 175
  • 1
    Eclipse is really powerfull, but can be really complicated. It's more than a IDE, it's a whole platform. Learn it and you will love it. BTW, I try to stick to VIM when possible ;) – Alois Cochard Nov 29 '10 at 14:49
  • I just tried this in my STS and it works like charm. You are doing something wrong ;) – Bozho Nov 29 '10 at 14:51
  • 1
    *God, I really hate eclipse.* Do you think that's going to improve the answers you get? BTW: I use eclipse STS on ubuntu and I have never had any problems at all with it (not since I switched to ubuntu at least) – Sean Patrick Floyd Nov 29 '10 at 14:53
  • I have bad luck with Eclipse. When I use IDEA, almost every time it just works. With eclipse, I am constantly annoyed at the small hassles and conveniences missing. – egervari Nov 29 '10 at 14:54
  • 1
    for me it's the other way around ;) – Bozho Nov 29 '10 at 14:55
  • Did you try with `/opt/jdk1.6.0_22/`? Perhaps the trailing slash makes a difference. Also, read permissions ok on that folder? – darioo Nov 29 '10 at 14:56
  • do you have appropriate permissions on that folder? – Bozho Nov 29 '10 at 14:56
  • Well, everyone has read permissions to it. Let me change the owner from root to my name and see if that works. That would be very weird if it does because IDEA and many other applications don't have a problem with the permissions as they are. – egervari Nov 29 '10 at 15:03

3 Answers3

6

Are you sure you are pointing to the JDK folder and not the JRE folder ?

You must select the root folder of the JDK installation.

Alois Cochard
  • 9,812
  • 2
  • 29
  • 30
  • Positive. The folder I am giving it is: /opt/jdk1.6.0_22 – egervari Nov 29 '10 at 14:52
  • No other idea than checking if your jdk/sts installation are corrupted ? or permissions not set ? Perhaps you simply experimenting the power of evil mondays... try out tommorow ;) ... just kidding ! – Alois Cochard Nov 29 '10 at 14:56
  • 4
    Yeah, even though it had read and execute access, I guess for some odd reason eclipse needed write access? I changed the owner from root to me, and that worked. I guess write access was needed. Very weird. – egervari Nov 29 '10 at 15:06
  • Really strange :-( I'm using Eclipse with Ubuntu, and never add to change file permissions... I totally agree that's weird you must give write access to the JDK folder ! – Alois Cochard Nov 29 '10 at 15:26
  • 1
    It's this kind of thing, as well as many other problems, that really spoil eclipse for me. I've been using TC Server /w Insight, and that's pretty good... but every now and then I get all kinds of aspectj errors, which I never get with IDEA. I also constantly get out of sync files if I have IDEA open at the same time. IDEA just resyns for you... you never have to think about, but with eclipse... all kinds of weird behaviour happens. Also not saving files automatically is actually a real pain. Just many things I think are many steps back from IDEA :( – egervari Nov 29 '10 at 22:21
1

On Ubuntu (10.04, Lucid Lynx) I ran into this same problem. I was pointing at a directory that was a symbolic link (logical) to the actual JDK directory. I got around it by pointing directly at the physical JDK directory (this is going to be an issue when Java upgrades, but its the best I could figure out).

Mike
  • 11
  • 1
1

On a default install of Ubuntu, even though there was a JDK folder, I noticed it didn't have the right stuff.

I had to install the JDK using apt-get as follows

apt-get install openjdk-7-jdk
Rob Kielty
  • 7,958
  • 8
  • 39
  • 51
Zamboon
  • 11
  • 1