Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Loading files OUTSIDE of a jar

Thread view: 
Sequalit - 23 Apr 2006 08:14 GMT
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)
andrewthommo@gmail.com - 24 Apr 2006 05:18 GMT
..
> ive tried everything,

Try using Upper Case at the beginning of each sentence.
(It won't solve your immediate technical problem, but
it might get you more, and better, help)

>...ive looked everywhere,

Does 'everywhere' include here?
<http://java.sun.com/docs/books/tutorial/essential/io/>

Andrew T.
Ferenc Hechler - 26 Apr 2006 19:45 GMT
Sequalit schrieb:
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.