File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes The resource is not in the build path of a Java project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "The resource is not in the build path of a Java project" Watch "The resource is not in the build path of a Java project" New topic
Author

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

Siva Padyala
Greenhorn

Joined: Jan 30, 2009
Posts: 2
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

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?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Jlover Saha
Greenhorn

Joined: Mar 22, 2011
Posts: 1

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

Joined: Feb 10, 2010
Posts: 71

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.


SCJP SCWCD AIX SOA
The significant problems we face cannot be solved by the same level of thinking that created them -- Albert Einstein

Brendan Kim
Greenhorn

Joined: Nov 16, 2011
Posts: 3
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The resource is not in the build path of a Java project
 
Similar Threads
jdbc program written in Eclipse3.2.1 to connect DB2
Open declaration of Eclipse
Eclipse 3 Book
project not in build path error in eclipse
JAXB unmarshalling problem