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.
Related
I hope it's OK to ask this here. Netbeans forums isn't responding. If not, I'll delete this or ask for it to be deleted. I'm desperate so I'll face the wrath, if any.
I moved my Netbeans projects folder from one directory node to another to make backing up all my stuff easier. BAD MOVE.
Now when I open a project using Files | Open project (ctrl-shift-O) NO source files appear because there is no "+Source Packages" node to expand.
It looks like this for all projects, e.g. one named GBL:
Projects
-GBL
+Libraries
It doesn't look like this anymore:
Projects
-GBL
+Source Packages (How do I get this back?)
+Libraries
The Netbeans Properties for each project shows me the path it's using. Windows 7 Explorer shows me that the src, build, and nbproject folders contain files and ALL the source files are in the src folder for that path.
What have I done and more importantly what should I do to get back to being able to open a project normally?
(I've tried recreating the original Netbeans folder and using Windows Explorer to copy an entire project folder into it but: same result--all I see is the Libraries node under the project's name node.)
I just tried to Clean (and also Build) to see what would happen. Error:
ant -f C:\\Users\\Dov\\Documents\\NetBeansProjects\\BasicShirt -Dnb.internal.action.name=build jar
C:\Users\Dov\Documents\NetBeansProjects\BasicShirt\nbproject\build-impl.xml:[u]231[/u]:
Must set src.dir
I just Set Configuration by right-clicking the project's name and provided a path to the src folder.
NOW I SEE MY SOURCE FILES BUT NOW THIS line in the .xml file is flagged with similar message:
<fail unless="[u][b]test[/b][/u].src.dir">Must set test.src.dir</fail>
NOW what do I do? (Netbeans 7.4.)
If I could get rid of the 7.4 automatic creation of +Test Packages, I might be OK.
If you can help, I'd be very happy.
(I'm considering re-installing 7.3 if available or removing and reinstalling 7.4 and try to avoid the "testing" requirement, but there goes all my many tweaks of 7.4.)
Well, after considerable frustration with the problem, I solved it, essentially.
It's here, in total. My synopsis plus how it helped me follows. In short, I had to set up a new java project based on existing sources using the New Project Wiz and simply direct Netbeans to the sources.
File > New Project
Choose Java Project with Existing Sources.
Type a (new) project name and ...
... make the Project Folder contains the path to where you want the new project to be stored. (For me, this is the folder where Netbeans has been able to find my sources.)
Click Next for the Existing Sources page of the wizard and ...
5a. ... in the Source Packages Folder pane, click Add Folder and ...
5b. ... navigate to your sources and select the source root folder.
Clicking Next goes to the Includes/Excludes pane, which I didn't need to use.
I have been tasked with maintaining a site that someone else created with Rapidweaver. Unfortunately, I only have the files that were published to the website. The Rapidweaver project files are gone. Is there any way I can re-create a Rapidweaver project from the published files?
I'm sure this is too late, but for anyone else out there with a similar question, you CANNOT recreate a Rapidweaver project from the published files. Now, looking at the code, you might be able to figure out which theme was used and start from scratch, but that is the best you are going to be able to do. Rapidweaver firstly depends on themes, but there are also many other plugins that could be used, and if you do not have these plugins or themes already installed, you would not be able to edit the original project file, much less the exported website.
Well, there is one way of getting it back. Use a program called "sitesucker" to download the entire site on to your hard drive. Look for a folder called "rw_resources" (NOT plain resources). You will find two subfolders "themes" and "plugins". Upon dropping down, there will be a folder by the name of the theme in the "theme" folder and folders with the name of the plugins in the "plugins" folder. Buy and install rapidweaver, stacks, plugins and theme. Create a blank project file. Open this project file in finder. Go back to the folder of the website you sucked out. Carefully transfer the relevant files to the blank project file. DO NOT mess with the "theme.plist" or "info.plist" files. Close the .rwsw sandwich. Restart rapidweaver. Your "blank" project should now be a recreation of the original site.
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?
I am searching for the bin folder in eclipse, but I am not able to find it.
I tried this following post, but I am not successful. Please can anyone help me?
what can I do to make display the bin folder on eclipse?
The reason why I am looking for bin folder is, I want to place some .dll files in it. Is there another way of incorporating .dll files? Any help is appreciated
You should not put any data in the bin directory. It gets deleted if you do a Project -> Clean. Instead you should put your libraries in a lib folder. I don't know how you are actually using your dll, but you can surely point to another directory.
If you are trying to include this dll only for development purposes, you can use LD_LIBRARY_PATH and include the path for your dlls. I did this in the past with eclipse. There are a location in the CDT eclipse project where you can include this.
If you are speaking about a java aplication that needs a dll, you can add the library in the project also like this http://www.dreamincode.net/forums/topic/96304-how-to-add-dll-files-in-javalibrarypath/, but I haven't done it never.
When importing a project into Eclipse, there is a checkbox "Copy projects into workspace". I want to know what does this mean. Do I need to select this?
Basically, you want to do this if you want to copy the files of the project you are importing under the workspace folder, and have two copies of the project on your computer at once. This may or may not be what you want to do. In my case it is not what I want to do, as I already have my projects placed in the proper and final location before I import them. My "workspace" folder remains void of project files. This is completely acceptable and is likely what a newcomer to Eclipse working on a test project will want to do. If you are working for someone else, you should ask your employer the setup protocol.
Every project in Eclipse is part of a workspace, which can be any folder, but usually developers keep the workspace folder as a parent to project folders. So, in this context, Eclipse is asking you, if you already have a workspace, whether you want to copy the project you are importing, to that workspace.
I will explain with an example: for my Android work, I have workspace folder called Android-<Product-Name>. In this I have library projects lib1, lib2, and the base Android project (called <product-name>) that uses those libraries. Hope this makes sense.