Sign in to follow this  
tHomahwk

[java] Adding files to the project in NetBeans

Recommended Posts

This probably belongs in the "For Beginners" forum, but this is more of a Java issue so I thought it belonged here. If its wrong...sorry!!!! Right now after every time I build my project in NetBeans, I have to manually add the data files to my jar file. How do I tell NetBeans to do this automatically? I tried looking through the XML files, but that didn't seem to help too much. *EDIT: Where do I need to put resource files so that in debug mode it will work properly? thank you, tHom [Edited by - tHomahwk on April 7, 2007 5:50:42 PM]

Share this post


Link to post
Share on other sites
On project properties, you can add resources to the packaging of your jar file. However, I prefer to do it with ant. There are several pre-built targets (pre-compile, pre-build) that you can override, and the IDE will call them for you at the right time.

To be able to see a resource file, it must reside on your classpath, as in any java program, independent of IDE. Therefore, you either add it in a special package in your code, or as a separate file added lately to the jar file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this