Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Including a file(How to include an external file into an jar)
Including a file [message #519893] Wed, 10 March 2010 06:52 Go to next message
Eclipse UserFriend
I have a file with properties. When i put the file in the eclipse project under bin/packagename everything works fine. I read the file with
getClass().getResourceAsStream("[filename]");

When i export the project in a runnable jar the file is not inluded. What do i do wrong?
Re: Including a file [message #519922 is a reply to message #519893] Wed, 10 March 2010 04:24 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

You may want to place the file in your source folder instead. Eclipse
should copy it to bin automatically, but more importantly, it should
also find it when creating a jar file.

Cheers,

Steffen

On 10/03/2010 11:52, hsc71 wrote:
> I have a file with properties. When i put the file in the eclipse
> project under bin/packagename everything works fine. I read the file
> with getClass().getResourceAsStream("[filename]");
> When i export the project in a runnable jar the file is not inluded.
> What do i do wrong?
Re: Including a file [message #520019 is a reply to message #519922] Wed, 10 March 2010 15:02 Go to previous message
Eclipse UserFriend
Thanks, that works.
Previous Topic:How do I update the jar in a "Plugin project for existing jar archive" ?
Next Topic:Jar making problem
Goto Forum:
  


Current Time: Sun Mar 23 05:12:43 EDT 2025

Powered by FUDForum. Page generated in 0.04615 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top