Eclipse - display build path projects in project explorer - java

In the Eclipse IDE, using the Java Development Tools (JDT), you can add a Java project as a reference for another Java project by configuring the Java Build Path. Go to "Project > Properties > Java Build Path". Under the "Projects" tab, add the referenced project (assuming it is in the same workspace). How can I get projects referenced in this manner to show up in the Project Explorer (or even the Package Explorer or Navigator) view(s)? If, under the "Libraries" tab, you add a JAR or Library, it shows up under the "Referenced Libraries" node. Is it possible to do something similar with projects from the build path?
Thanks.

Related

Eclipse I can't link project B to project A

I work with Eclipse. I have two projects in the workspace. This is my Eclipse navigator.
I want to add AR04.CME to cmeWeb.
Folder cmeShare has some jar which I need in cmeWeb.
I click in cmeWeb properties ->Java Build Path -> Projects
This is the screen
AR04.CME doesn't appear as project.
How can I add this project?
Linking Project A to another Project B is useful when you have source code in A that you want to share to B. That's not your case. You don't seem to share source code, but a compiled library instead.
Your best option is to edit cmeWeb's Build Classpath > libraries > add jar > select your Jar library.

Can't call a class from another git project in Eclipse

I imported a project from github into Eclipse (project A), using these steps: Importing a GitHub project into Eclipse
I have another app engine project I am building in Eclipse (project B). I would like to import a class from the project A to project B. I was trying to follow these steps: How can I refer to a class from another project in the same Workspace in Eclipse/Java
But when I go to project B's Java build path --> Projects --> Add, the select project window does not show the imported github project.
If I create another local Java project (project C), I can see project C as an option to add to project B's build path.
Make sure you are copied project A into your workspace while import into eclipse.
There is a check box option for copy project into workspace in eclipse import project.
First, You will have to fix the project A at eclipse before importing into the project B... By fixing, I mean setup the source paths of the project A (example, the folder src/com/google, should be a source folder at the project A configuration)... The Project A must compile (if the project A cannot be compiled by eclipse, I doubt that you will have success at importing it into project B)
Another strategy would be use the ant script of the project A and import, as java library, the artecfacts generated by those ANT files into the project B.

Adding Java builder to .project file in Eclipse

I need to add a Java builder to mt .project file in Eclipse. However, there is no such file in my project folder. I don't know where this file is, maybe you can help me out?
In Eclipse, the .project file is kept in the root directory of your project, which is in your workspace. It's easy to see if you do a directory listing in your underlying filesystem. If you want to find out where your workspace is, find it by looking at the project in the Package Explorer. right-click > Properties > Resource > Location.
It might be better to use Eclipse itself to add a builder to your project, for example, using the Package Explorer - project right-click > Properties > Builders feature.
Convert the project into a faceted project. This generally happens when you import a project from git and the project is not a java project.
Steps:
Right Click -> Properties -> Project Facets
Click on convert project into a faceted project
Select the builder as java builder.

Exclude files from JAR build with Eclipse

I have a folder at the root of my Eclipse Java project to hold configuration files for the application and log4j2. The only way I can get the in IDE build to work is to add that folder to the Java Build Path of the project.
I need to exclude either this folder or the files therein from the JAR file export. This will allow it to look in the same folder for those 2 configuration files.
Right click on the project folder in the Eclipse Package Explorer.
Select "Build Path", then, "Configure Build Path".
Go to the "Source" tab that appears. (You should be automatically selecting "Java Build Path" in the left hand side of the popup window)
Open the folder for your project, and click on "Excluded", then click "Edit" on the right hand side.
From this window, you should be able to click "Add..." in the exclusion patterns. The dialogue box should have a "Browse" button that will allow you to exclude specific classes or packages. The input also accepts wildcards.
You could pack your dependencies project into jar(wihout excluded files). Then pack as previously.

How to include maven built library into your project in eclipse?

I am a novice and don't have much idea. So I have a library that is built with Maven and I want to include this library in my java project in Eclipse, how do I do this? I am using Eclipse juno on MacOSx. I want to run one of the modules in this library, so the source code is provided for this module but how do i run this?
If you are not using maven, you have to download the jar and the sources of that jar (In your case, you can download the zip file provided on the website you mention : http://code.google.com/p/cleartk/downloads/list ) and put it somewhere on your computer.
Then you have to set the build path of your project in Eclipse :
Right-click on your project -> Properties -> Java Build Path
Then you can click on the Libraries tab and Add External Jars so you can point to the jar you downloaded.
In this tab, you can attach the sources of this jar to have access to the source code in Eclipse (and eventually set breakpoint).

Categories

Resources