Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: trying to load jnilibraries from a standalone app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trying to load jnilibraries from a standalone app



i found out a bit more, and a hack to get around it......

even though i can't set the -D... stuff i can set the environment DYLD_LIBRARY_PATH and the app picks it up from there.
notice i am setting the DY_LD_LIBRARY_PATh and NOT the LD_LIBRARY_PATH.
once this is set all is well.

as to why it is not working i do not know yet. maybe it is the shell i am using, tcsh and not bash?

anyway setting the environment variable seems to clear it up for now...

ken;
On Jul 1, 2004, at 5:09 PM, Greg Guerin wrote:

Ken Hawkins <email@hidden> wrote:

i have a standalone java app that uses swt and swingwt. it is failing
trying to load
a swt required library. this is my line to run the app:

java -Djava.library.path=.
-Xbootclasspath:/Developer/projects/Broadjam/trunk/soma/dist/swt.jar:/
Developer/projects/Broadjam/trunk/soma/dist/swt-pi.jar:/Developer/
projects/Broadjam/trunk/soma/dist/swingwt.jar:/System/Library/
Frameworks/JavaVM.framework/Classes/laf.jar:/System/Library/ Frameworks/
JavaVM.framework/Classes/classes.jar -classpath <...> -jar
/Developer/projects/Broadjam/trunk/soma/dist/Metajam.jar

My first guess is that there may be a security restriction for
bootclasspath elements, whereby "java.library.path" is NOT used. I suspect
the property "sun.boot.library.path" would be the library-path that
corresponds to "sun.boot.class.path". All I did was enumerate and print
all system properties, piped through 'sort'.

Is there some reason why SWT et al. has to be in your boot-classpath, as
opposed to someplace less privileged, like the normal classpath, or as a
Java extension?

Also, I could be misremembering, but -jar and -classpath may be mutually
exclusive. See 'man java' for details.


has anyone been able to properly link a jnilibrary from the
command line at run time?

Frequently. It works fine. But I don't mess with bootclasspath.

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


References: 
 >Re: trying to load jnilibraries from a standalone app (From: Greg Guerin <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.