• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The resource is not in the build path of a Java project

 
Siva Padyala
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have checkedout the maven project from SVN and its successfully building the war file and working fine, Problem is in eclipse when i am trying to navigate thru java files using F3 (cntrl+left click) its is saying that "The resource is not in the build path of a Java project".

How can i resolve this issue.

Thanks
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Can you provide more details please? Are you using the eclipse maven plugin? What version of teh plugin and eclipse are you using?
 
Jlover Saha
Greenhorn
Posts: 1
Eclipse IDE Java Windows XP
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have also faced this problem recently & realizing the quick need of different people, adding my solutions that helped me.

First of all let me explain the problem i faced, i had couple of java projects in our SVN repository. i checked out the projects from the reporsitory,
But when i opened a java file from the project, i realised i did not checked out the project as Java project during checkout, which was my number one problem.

1) So lesson i learned was, whenever you checkout the project from the repository, make sure the project was not checkedout straight, instead you have to define the project type you are checking out to get the benefit of java project.
For Ecplise 3.1, Right click the project on repository[CVS or SVN] ==> Checkout ==>Checkout as a project configured useing new project wizard ==>Select Java Project or J2EE project ==> Than finally checkout.
For Ecplise 3.6, Right click the project on repository[CVS or SVN] ==>Find/Checkout as ==> Checkout as a project configured useing new project wizard ==>Select Java Project or J2EE project ==> Than finally checkout.

2) Than you have to right click on the project ==>properties==>Java Build path==>you have to go to the "Add Jars" & than keep adding all the required jars to run this project.

3) Final lesson, You have select src or source code folder and need to add them as Source folder,
For Ecplise , select src folder and right click ==> Build path ==> Use as source folder


Hope this helps for someone.

Thanks
love4java


 
sourabh girdhar
Ranch Hand
Posts: 71
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice step by step explanation-

2) Than you have to right click on the project ==>properties==>Java Build path==>you have to go to the "Add Jars" & than keep adding all the required jars to run this project.


If you are using maven project , you should add jars as dependency in POM. Adding jars directly from local computer can cause issues while packaging or installing from maven.
M2clipse plugin provides a very good POM editor.
 
Brendan Kim
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this if you're using relatively a new Eclipse. (Mine is based on Eclipse 3.7)

1. Window > Preferences > Java > Installed JREs
2. Select the JRE you use and click 'Edit...' button on right.
3. In 'Edit JRE' popup, click 'Directory...' button and select <JDK_HOME>/jre (note you don't select just JDK_HOME directory)
4. Click OK and click Finish and finally Ok button
5. If it doesn't automatically build your project, do it manually by 'Clean...' to make sure

Now try it again, open the class, click the name and press F3.

Brendan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic