Loading files OUTSIDE of a jar

S

Sequalit

Heheh... yeah i know i know, this should be an easy one... not

ive tried everything, ive looked everywhere, i cant seem to find an
answer. I saw posts that people made on loading resources that are
inside a jar and having problems... and it worked fine if the res were
not in the jar...

well im having the opposite problem. i cant load anything outside the
jar else it returns null... it works perfectly when i run in eclipse,
but it hates jars

(ive tried using .getClass.getResource() blah blah blah doesnt work)

but my file is a .properties that is external to the jar (jar is jnlp,
properties is a simple save file)
 
F

Ferenc Hechler

Sequalit said:
i cant load anything outside the
jar else it returns null...

If you start your jar using "java -jar xxx.jar" you have to set the
Class-Path entry in the Manifest to ".".
Add the following line "Class-Path: ." to your "META-INF/MANIFEST.MF"
before the first empty line.

Best regards,

feri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top