Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Main class directory



Hi all,

This is not a mac specific question.

I'm porting my app developed using CW8 on MacOSX to Windows using Sun ONE
Studio 5.

Everything works fine, but the following: when debugging, the IDE sets the
working directory to java.home rather than the main package directory. This
prevents some of my classes from finding files that reside beside the jar
package. I'm loading these files using the following:

String path = System.getProperty("user.dir") + "/MyFile.ext";

I'm trying to find a way to retrieve the main class package directory,
something like:

String path = System.getProperty("mainclass.dir") + "/MyFile.ext";

Or

String path = MyMainObject.getClass().getPackage().getPath();

But I cannot find it. Anyone knows how to do this ?

Thanks,

Eric
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >B ufferedImage form Graphics (From: "aNt" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.