6

I had installed Eclipse Galileo first and after that installed Java.

But it is not detecting my java.

What configuration changes can I make so that Eclipse can run my java programs?

========================== Edited ================================

Community
  • 1
  • 1
Amit
  • 33,847
  • 91
  • 226
  • 299

2 Answers2

6

You can specify the exact jvm you want to use through:

Once started, you can reference as many JVM you need in the Installed JRE preference panel

alt text http://img168.imageshack.us/img168/3307/eclipseinstalledjre2.png

Finally, you need to reference the JVM you need in the Libraries tab, in your Java Build Path properties of your Java project (as mentioned by Steve in his answer):

alt text http://img52.imageshack.us/img52/5947/eclipseinstalledjre3.png

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I followed your answer but the problem is still a problem. So I have attached a screenshot showing redline under import statements. – Amit Feb 24 '10 at 12:56
  • Now the problem is solved. I forgot to add the jre-library to the project buildpath. – Amit Feb 24 '10 at 13:04
  • @Yatendra: good point. I have updated the answer to illustrate that last setting. – VonC Feb 24 '10 at 13:18
4

It seems, that your project doesn't have the JVM in it's Build Path.

Right-Click on your project. Choose Build Path --> Add Libraries.... Take JRE System Library and choose a JVM for your project.

Steve
  • 18,660
  • 4
  • 34
  • 27