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: How to add the Apple Java jar for com.apple.* in Eclipse



I've not done AppleScript in Java, but I do code a Cocoa-Java application in Eclipse that uses the Cocoa classes (com.apple.cocoa.*). There is not a jar file with these classes in it (that I know of). All of the .class files are stored loose under the /System/Library/Java folder.

You can either jar them up yourself and add them to your Eclipse project as a normal 3rd-party jar, or you can create a class folder to reference them. There might be a better way, but this is how I got it to work (Eclipse 3.0):

1. Open Project Properties, go to Java Build Path, Libraries Tab
2. Click Add Class Folder
3. Select your project folder and click Create New Folder
4. Give this new folder a name, I called mine CocoaLib, then click the Advanced button
5. Check the checkbox labeled "Link to folder in the file system"
6. Click the Browse button, and browse to /System/Library/Java and click Choose
7. Click OK on all of the dialogs and you should be able to build just fine.


If you need help or clarification, just let me know, or if someone knows of a better method, that would be great as well. Since Apple does not provide proper JavaDocs for these classes, I have considered manually running JavaDoc against them and jaring them up with their docs, I just haven't gotten around to it yet.

Logan Allred

On Oct 4, 2004, at 1:14 AM, Wolfgang Chico-Töpfer wrote:

Hi,

Recently I tried to call AppleScript from Java using Eclipse.

I noticed that Eclipse did know any path or JAR for com.apple.*,
actually it seems only the extension jars are known.

I tried to locate them and add them with "add path" in the properties
dialogue of Eclipse but to no avail.

Any one tell me how I can add the JAR (..and which one by the way, too ;) ?

Thanks a lot,
Wolfgang.

_______________________________________________ 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: 
 >How to add the Apple Java jar for com.apple.* in Eclipse (From: "Wolfgang Chico-Töpfer" <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.