I am having problem while importing project in eclips.
Actually there is no problem in importing project in from the same computer but if i am taking the project from another computer and importing it in my system's eclipse , it does show many errors.
Can any body tell me how to deal with this situation ?
It probably has something to do with some file paths on your computer not being the same as on the one that you copy from. But without any more details about the errors you get it is really hard to say.
You can open the .project file in a text editor and see if there is anything suspicious in it.
Pay attention if your project has some linked resources like other related projects. As you can see in the .project file, the path to that resources is absolute.
Moreover, did you used the correct import procedure to import the project in the workspace?
Related
After I import my maven project to eclipse, it created eclipse project files in my maven project. How do I clear them out?
After your comment "if I dont clean the project files, how to I hand it over to someone else? If they dont use eclipse would they be appreciate all those extra files unrelated to the project?" I have understood your need.
The best way to achieve it is to use a version control system (VCS) like git, svn etc. and add inside your project tree a special file call .[VCSofYourChoice]ignore. For example for git this file would be .gitignore for svn it would be .svnignore.
Once you created this file you add rules to exclude files or directories you don't want to share on your version control system of your choice. To find the syntax to use google it with keywords ".[VCSofYourChoice]ignore syntax".
Eclipse and eventually every IDE create specific files, in order to save project structure and other internals. Some of them prompt you to select in which folder you want to save these files, for example IntelliJ, but I am sure eclipse as well. So you every time you use and IDE and you import a project, some files are going to be generated. The cleanest way is to 1) select to save them in a folder not related with the actual project, and as it already suggested do not commit them and add them in an ignore list, on your VCS of choice (e.g git)
I have my eclipse project setup as follows. As you can see I have 'gamedata', 'images', and 'sounds' folders set in my buildpath as libraries.
Here is the folder structure of my project.
I have been work on this client server game for quite some time now in eclipse and all is well. I wanted to try to 'export' this as an 'executable jar' file. I did that and when I went to run it, I got an error loading an image. I then extracted the contents of that jar file to see why it was missing and realized that the 'gamedata', 'images', and 'sounds' folders are all not there, rather their subfolders/contents are at the top level.
This is the extracted folder below where you can see the missing top level folders.
Can anyone help me out here? Sorry if this is a stupid question but I have tried so many things in the build path and admittedly do not have much familiarity with it. I have tried to look online for proper project setups(I remember using a res folder in programming classes way back) and would appreciate any guidance on best practices as far as folder naming is concerned.
Thanks for any help here.
You need to declare images and gamedata under a "resources" folder, as in this question
Right-click your project, new, Resource Folder.
Add the path you want (images and gamedata).
Then select the option "Export Java source files and resources" when creating your jar executable.
I have an existing SBT project which I'm primarily working on using Emacs with Ensime; I would like to keep it that way. However, I would also, occasionally, like to edit and refactor (and if possible, compile and run) the same project in Eclipse Scala IDE.
I don't seem to be able to go about doing that without the project folder being copied to a workspace. I've tried both [Import -> Existing Projects into Workspace] as well as [Import -> File System] to no avail—both seem to cause a copy to be made.
If it's something simple and obvious, I apologize; I'm quite a beginner with Eclipse. Also, I did ask Google, but couldn't find anything that is similar enough—usually it's just people moving away from one editor/IDE to Eclipse, so they don't care about the code being copied in the import process.
P.S. I tried opening the containing folder of the existing project as the workspace, but after that, the workspace is still empty.
P.P.S. One might ask, why not just make the Eclipse workspace the primary location of the project and then edit it with Emacs there, but that would mean changing my existing "standard" layout, or moving just one project out to a dedicated Eclipse workspace or smth. So I think it would be nice to just edit an existing folder with Eclipse without having to move or copy it.
OK, got it; it was easier than I'd thought: Just create a new (Scala) project with the path of the existing project (uncheck [Use default location]), and it seems to Just Work.
Using libgdx and just trying to get the HTML version of the basic setup is driving me crazy. I get this error
Loading modules
com.me.mygdxgame.GwtDefinition
[ERROR] Unable to find 'com/me/mygdxgame/GwtDefinition.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR] shell failed in doStartup method
this happens unless i actually named my app com.me.mygdxgame
i can't find any mention of this link(com.me.mygdxgame) any where in any of the .xml files and don't know where eclipse is getting it from. It gets that error on loading the index.html file but even in it the links are correct. Any help would be appreciated.
and i just searched for any mention of mygdxgame in all file in the workspace and got back 0
OK found out what it was.
The war directory was somehow getting cross linked to a same named game so no matter how many times i remade it it was getting linked to an old folder i had before. So even though all the directory's in the properties looked right the war folder was wrong. to fix it i had to un-check the "This project has a war folder" from the property's |Google|Web Application tab apply it then i tried running it as a web app it told me i didn't have a war directory so it would not run. That part may not be necessary but when i rechecked the box and re-selected the only war folder it would let me. the next time i ran i got to re-select the war folder from a full directory and not just my projects directory. This fixed the problem.
Just to clarify Eclipse seems to save war folder information by the name of the folder in which the project is contained what happened in my case was i had created a folder called MyGame in which i stored a project named com.me.mygdxgame the default for using libgdx. later i renamed that folder MyGame_old and started over with a new MyGame folder in which i named the project anything else doesn't matter the point is it never asked me for the war folder when i went to run it the first time, it just assumed somehow i was using the old one which was now in MyGame_old don't know how it found it but it did. so it was reading old files with bad links.
hopefully this might help someone else with this problem.
I came across this error as well but your suggested fix didn't work for me. After some investigating, here is what I did to get it to run: open the "Run Configurations" for the project and then click on the "Arguments" tab. Remove any reference to the com.me.mygdxgame.GwtDefintion in the arguments.
After this, project ran error free. Hope this helps.
After reading some posts it was clear that this problem was caused by GWT. One main reason for this problem is you are constantly reusing the same port and GWT is reusing the old properties.
There is really simple fix for this.
right click -html project.
Run-> run configuration.
Go to server tab.
check automatically select an unused port.
Press apply and
Does anyone know how Eclipse determines which projects are in a particular workspace? Is there a config file somewhere with this info? I have struggled (in vain) for several hours trying to figure this out. I'd like to be able to edit this config / check it into SVN...
I think Eclipse works much better if you manage just the individual projects in your version control system.
You can publish the set of projects that make up a workspace as a Project Set File (an XML file that can be created as Export > Team > Project Set), which you could put in your repository. This file contains the repository location for all projects, so that they can be checked out all at once.
I agree with Thilo that it is not a good idea to put the workspace metadata into your version control system.
However, in the spirit of answering the question and letting others make their own value decisions: The directory ${workspace_loc}/.metadata/.plugins/org.eclipse.core.resources/.projects should contain one directory for each project that eclipse uses to keep track of where the project is on disk and a whole bunch of other information.