currently, I'm trying to use a pac-man simulator that I found in the github in this link.
The project is consist of two main folder. Pacman-vs-Ghosts and Pacman-vs-Ghosts-Agents. I was able to run the codes inside Pacman-vs-Ghosts folder by using 'import existing project' option in the eclipse.
However, I could not figure out how could I run the second folder Pacman-vs-Ghosts-Agents. On the repository readme, it is written that
PacMan-vs-Ghosts-Agents -> example agents (both Ms PacMan and Ghosts), this project must reference PacMan-vs-Ghosts in order to compile
However, this is my first time with Eclipse so I could not find how to reference to Pacman-vs-Ghosts from the PacMan-vs-Ghosts-Agents project.
If possible could you explain me point by point (couple of picture would be great) how to do that?
You have many means .
1 If you have the source code and know what you want to reuse, just extract some java files, and put them in your project
2 If you have many dependancies, or if you want simply solution, get it or package it as as Jar , and include it in your project
You need to import both projects into the same workspace. Then you right click on the dependent project (PacMan-vs-Ghosts-Agents), Build Path > Configure Build Path, go to the projects tab, click Add and select the dependency (Pacman-vs-Ghosts).
Related
One of my eclipse projects gives me the Project X is missing required library: 'somelib.jar' error, but when I go to Configure Build Path > Libraries the library is present, and no error is indicated there.
I tried the usual things:
Clean build (all projects in the workspace)
Exited eclipse multiple times
My coworkers, using the same git checkout with the same status as mine, and also using eclipse Neon2, have no build errors.
Just to be sure, I navigated into the corresponding directory and removed a different jar file, and when I look at my build path configuration that jar shows up with a red "x" indicating that the library is missing.
I checked that somelib.jar sits in the expected place and is a valid JAR file.
How do I fix this?
These steps did resolve the problem:
closing / re-opening the corresponding project
another "full" clean of all projects in the workspace
In other words: it seems that a simple F5 "refresh" and a even a "clean project" isn't sufficient sometimes. So closing the project is the key element here!
Some times eclipse becomes naughty following steps should be taken to nicely add the jar library in project
First remove the library from libs folder
Also remove the refrence from java build path in external library tab
Clean the project let it actually realize the library is missing :D
Again copy the jar file in libs folder
Add the refrence of library in java build path library tab
set the priority of this library to top (important) because its
possible the order of library export is not ok in your project
Clean the project and build
hope so it will solve your problem
If you have multiple projects opened in such way that one depends on another, and the problematic project depends on others, refreshing all dependent projects will fix the 'missing library' issue for the main project.
Pretty much as the title says: I have two projects. One of them has a referenced library with a class called, say, com.foo.Bar. So then in my other project I have the first project on the build path, and I try to import com.foo.Bar.
That should work, but eclipse doesn't recognize it, even after I save and run it. Any idea on how to fix that?
(And not just "add the library to the build path of the second project.")
On the Java Build Path property page of the first project, you would need to Export that library entry to make it visible to other projects that depend on the first project.
I have multiple project source which I checkout from SVN and put in project one
I want project two to point to specific part from these sources and
project three to another part of the sources from this multiple project.
How can I do that in eclipse ?
So when I make a change in project two, when say SVN synchronize on project one to see that the sources have been changed.
PS. I use gradle and for me it is much easier to build only one subproject, not the whole tree every time and ofcourse to see Eclipse Ctrl+space helps.
Right click on project two, and left click on Properties.
Left click on Java Build Path. Left click on Add Class Folder.
Check the class folder (bin) from project one. Left click on OK.
Back on the Java Build Path dialog, left click on OK.
Go to your second project's properties, to Java Build Path, then to the Source tab, and click on Link Source... button. There, click on Browse... button and select the src folder of your first project. This will allow you to change the source files from either project, and compile them from either project as well.
I wan to share one of my Java classes form existing Eclipse project with other projects.
I am doing it manually with menu: File -> Export -> Java -> JAR file.
I am dealing with frequent code changes in referenced Java project, therefore, unnecessarily spending time on this step that can me automated. My challenge is how to tie this step to project build step. Any ideas ?
Best
i think you must extract the just the jar and place it in the your eclipse working directory
,it could solve your problem......
It's been tedious. This is the API I am trying to use. Its resources were set up in a pom.xml which I built using Maven. On built up, it gave me the project socrata-publisher that has
src/main/java the source folder with packages com.socrata.api com.socrata.data, com.socrata.util where each contains only .java
files
JRE System Library and Maven Dependency hierarchies where each contains a number of jar files
Problem is com.socrata.api and the 2 other contains classes which I want to deploy in a project outside socrata-publisher. I tried using import com.socrata.api but it didn't work. Moreover, since its a Java project and not android it doesn't have the is Library option in preferences which could rather give me the solution. Both socrata-publisher and tutorial (where i want to use the resources and which is the android application) lie in the same directory eclipseApps in My Documents.
Here's a little visual queue. Help will be greatly appreciated.
You will need to first of all get the output of the socrata project and all its dependencies.
In command line, going to the project folder of the socrata project, where the pom.xml file is, run MVN INSTALL. You shall see a jar file called socrata-api.jar in $HOME/.m2/repository. If you are using windows and installed MAVEN by default, $HOME should be your user profile folder. Once you see the jar file, add it to your tutorial build path.
I think what you actually want to do is just set up the "socrata-publisher" as a project dependency for your "tutorial" project. That will allow you to reference the built Socrata libraries from the code in your project.
Right click on the project and select "Properties". From within that dialog select "Java Build Path" on the left, then the "Projects" section, and click the "Add" button to add the "socrata-publisher" project.
I think that'll work better than creating a separate jar file that you then include, and then you can also keep the socrata-publisher code up to date using Git.