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



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.




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.