3

I am new to the eclipse environment. I clone my project from the repository(Hg) by New->Project->Mercurial->Clone existing project. Here my problem is "This compilation unit is not on the build path of a java project" message comes when I editing the coding. Auto completion not working. Kindly let me know how solve this problem...

Note: I searched in google as well as in stackoverflow. But still I am not clear in that.

Deepak Mani
  • 1,099
  • 2
  • 15
  • 20

2 Answers2

7

I had this problem in Eclipse on Windows 7 as well. The solution is Go to Project-> right Click-> Select Properties -> project Facets -> modify the java version for your JDK version you are using. Please note, if the JDK version of the project is higher, say, 1.5 and your project setting is jdk 1.4, then it will not work. Vice versa will work.

kor_
  • 1,510
  • 1
  • 16
  • 36
Jaiprakash
  • 71
  • 1
  • 2
-1

Right click your project, select properties. On the left side select Java Build Path. Go to the Libraries tab and select the JRE System library. On the right side, click the edit option. Select the Alternate JRE radio button. See if the JDK you have installed is present in your drop down and select it. This should fix your problem.

Arvind Sridharan
  • 3,885
  • 4
  • 29
  • 54
  • 1
    Its working for normal java projects. The problem is in Hg cloned project only. Where the option java build path is not available as option. What I have to do now? – Deepak Mani May 24 '12 at 06:34