Java Bridge and Weird Jar File
Java Bridge and Weird Jar File
- Subject: Java Bridge and Weird Jar File
- From: Edison Thomaz <email@hidden>
- Date: Mon, 25 Aug 2003 10:43:22 -0700
Hi,
I am trying to use a Java API in my Obj-C code and I am running into a
particularly nasty problem.... First of all, I got the basics of the Java
Bridge working. I read the article at
http://cocoadevcentral.com/articles/000024.php#000024
and I can run Java from my code without issues. I set NSJavaRoot to
Contents/Resources/Java and included the jar file in the NSJavaPath. I know
I am calling the jar files ok because I am getting error messages from it.
So far so good. The problem is that the Java API that I am trying to use is
... hmm.. weirdly designed, not to say poorly designed. The jar file
requires a number of external "support" data files and it assumes that these
data files are in the same directory as the main class that imports the jar.
So, given a main class called 'foo' located in directory 'bar' that imports
'stuff.jar', the only way for 'foo' to run without problems is if support
files 'x', 'y' and 'z' are also in directory 'bar'. 'stuff.jar', the owner
of 'x', 'y' and'z' can be anywhere, as long as it's in the class path.
There lies the problem. From Cocoa, I can place 'stuff.bar' in
Contents/Resources/Java and everything is ok. But I need to find a place for
'x', 'y' and 'z' such that when the app runs outside Project Builder, they
end up where the executable is. But I've tried a bunch of places and it
hasn't worked. What I can say is that when I place 'x', 'y' and 'z' together
with the executable in the 'build' directory and run the app from PB, it
works. Otherwise I just get error messages from the jar through the bridge
saying that the support files were not found.
If you have any ideas, comments, suggestions, I would appreciate it.
Thanks,
Edison Thomaz
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.