• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: debugging jnilib from XCode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugging jnilib from XCode


  • Subject: Re: debugging jnilib from XCode
  • From: David Ewing <email@hidden>
  • Date: Fri, 19 Mar 2004 00:24:35 -0700

Hmm, that's weird. You certainly shouldn't need to point dyld inside a framework to get this to run. There must be something strange about how you link, or maybe you have other environment settings for your executable. (Or maybe I'm just missing something here. ;-)

Dave

On Mar 18, 2004, at 8:41 PM, Dmitry Markman wrote:

thanks David

as I thought WebKit framework was a problem

I used your recommendation and set
DYLD_LIBRARY_PATH=/System/Library/Frameworks/WebKit.framework/ Versions/A


and magic occurred!

thanks again

now I'm able to debug my CocoaComponent related jnilib
(I was tired from NSLog and printf :-)   )


On Mar 18, 2004, at 12:06 PM, David Ewing wrote:

It's not obvious from your description what's going wrong. IIRC, Xcode sets the DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH environment variables to include the products directory. This may change what libraries were found by your JNI lib. You can try setting the environment variable "DYLD_PRINT_LIBRARIES" to see what libraries are getting loaded in each case. (In Terminal, type 'man dyld' for documentation on these environment variables.)

Hope that helps,
Dave

On Mar 17, 2004, at 11:52 PM, Dmitry Markman wrote:

Hi
I have some problem with debugging my jnilib.
here is my story

1. I created jnilib application from Project New template
and I was able to debug jnilib in that project
so it's possible to debug jnilib from XCode in principle
good news :-)

2. I created my application that uses my jnilib library
and here I have a problem
I created executable that looks very similar to executable from template above:


path: /usr/bin/java
launch arguments: -cp WebKit.jar org.dm.webkit.WebKitJava
choose working directory : Product directory: /Users/dima/Projects/JavaProjects/1.4/WebKitSample/build
so when I try to run that executable
I got the error:


java.lang.UnsatisfiedLinkError: /Users/dima/Projects/JavaProjects/1.4/WebKitSample/build/ libwebkitsample.jnilib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at org.dm.webkit.WebKitJava.<clinit>(WebKitJava.java:13)
Exception in thread "main" java.lang.UnsatisfiedLinkError: createNSView
at org.dm.webkit.WebKitJava.createNSView(Native Method)
at apple.awt.CToolkit.createCanvas(CToolkit.java:368)
at java.awt.Canvas.addNotify(Canvas.java:74)
at org.dm.webkit.DMWebKitView.addNotify(DMWebKitView.java:42)
at java.awt.Container.addNotify(Container.java:2049)
at java.awt.Window.addNotify(Window.java:418)
at java.awt.Frame.addNotify(Frame.java:482)
at java.awt.Window.show(Window.java:459)
at org.dm.webkit.WebKitJava.main(WebKitJava.java:141)



if I run the following command from the terminal

cd /Users/dima/Projects/JavaProjects/1.4/WebKitSample/build
java -cp WebKit.jar org.dm.webkit.WebKitJava

EVERYTHING IS FINE!

if I remove libwebkitsample.jnilib from the
/Users/dima/Projects/JavaProjects/1.4/WebKitSample/build
folder I got the other error:

java.lang.UnsatisfiedLinkError: no webkitsample in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)
	.....

so when I HAVE libwebkitsample.jnilib in the directory
I'm getting different error, that means that java indeed CAN FIND that jnilib
but for some unknown reason fails to load that library (again only from XCode)
it looks like that system fails to load jnilib because it can't find
some dynamic libraries, but I don't use any dynamic libraries
(at least explicitly)
jnilib target is old style target (not native)
it includes the following frameworks:
Cocoa.framework
JavaVM.framework
WebKit.framework
and
libstd++.a static library


(Apple's jnilib template uses only JavaVM.framework
so maybe WebKit.framework tries to load some dynamic libraries and fails)
I played with java.library.path but it didn't help.


thanks

Dmitry Markman
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.




Dmitry Markman
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: debugging jnilib from XCode
      • From: Dmitry Markman <email@hidden>
References: 
 >debugging jnilib from XCode (From: Dmitry Markman <email@hidden>)
 >Re: debugging jnilib from XCode (From: David Ewing <email@hidden>)
 >Re: debugging jnilib from XCode (From: Dmitry Markman <email@hidden>)

  • Prev by Date: Re: wstring
  • Next by Date: Limitations on number of files in a package
  • Previous by thread: Re: debugging jnilib from XCode
  • Next by thread: Re: debugging jnilib from XCode
  • Index(es):
    • Date
    • Thread