On Sat, 19 Apr 2008 20:41:24 -0700 (PDT), Chase Preuninger
<chasepreuninger@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>I am running netbeans and I have a rtf I want to put in the jar that
>is built with my app so that I can read off it later when my program
>is running. The only problem is that I don't know how to get it into
>the jar.
you could put it in like any other resource.
see http://mindprod.com/jgloss/jarexe.html
or use an ANT script.
see http://mindprod.com/jgloss/ant.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Chase Preuninger - 20 Apr 2008 05:05 GMT
that would work but I am talking about in the context of netbeans
Mark Space - 20 Apr 2008 05:18 GMT
> that would work but I am talking about in the context of netbeans
Right click on the package you want it in, select "Empty File" (you
might have to go down to "Other" and use the wizard). Type in the file
name.
Then just replace that blank file with yours.
I think you can just drop files in the source dir and they'll be
included in the .jar, but I'm not sure about that. I'm 99% sure the
directions in the first paragraph will work. Play around with it.
Chase Preuninger - 20 Apr 2008 12:09 GMT
the second one does work!
Chase Preuninger - 20 Apr 2008 05:13 GMT
also if I wanted to read the file out of the same jar that contains my
running app, what is the beast way to do so?
Mark Space - 20 Apr 2008 06:08 GMT
> also if I wanted to read the file out of the same jar that contains my
> running app, what is the beast way to do so?
<http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getResourceAsSt
ream(java.lang.String)>