Mailing Lists: Apple Mailing Lists

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

Re: Cocoa with Java in a Jar based java application



try to add to your manifest file the following line
Class-Path: /System/Library/Java/


On Jan 22, 2006, at 9:12 AM, Andrea -XFox- Govoni wrote:

I need to use Cocoa Java classes in my jar based Java application.
I tried to use the com.apple.cocoa.foundation.NSArray class.
The Xcode project builds the jar file without errors, but when I try to
run it I get:


"Exception in thread "main" java.lang.NoClassDefFoundError:
com/apple/cocoa/foundation/NSArray"

I found this similar [1] thread but the suggested solution of adding
/System/Library/Java/ to my application's classpath doesn't work because
in a jar based Java application the classpath is read frome the jar's
manifest file and the Class-Path header field accepts only paths to jar
files.
So, since there isn't a system jar file containing the Cocoa Java
classes, how can I do?


Maybe I could archive the com.apple.cocoa.foundation class files in a
single jar file, but then I should distribute it with my java
application and, AFAIK, it could probably not work on systems with
different Mac OS X version.


[1] <http://lists.apple.com/archives/java-dev/2005/Aug/msg00097.html>

--
Andrea "XFox" Govoni

AIM/iChat/ICQ: email@hidden
Yahoo! ID: xfox82
Skype Name: draykan

PGP
KeyID: 0x212E69C1
Fingerprint: FBE1 CA7D 34BE 4A53 9639  5C36 B7A0 605F 212E 69C1
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

Dmitry Markman

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Cocoa with Java in a Jar based java application (From: Andrea -XFox- Govoni <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.