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: Problem linking with NSAppleScript from Java+Swing



Andy Wolpert <email@hidden> wrote:

>I want to call NSAppleScript from a Java+Swing application.
>
>I get a NoClassDefFoundError err.

What is the application's classpath?

Exactly how are you executing the application when the NoClassDefFoundError
occurs?


>A simple command line program compiled with javac works fine, as does a
>Cocoa+Java application.

What is the simple command line program?  Do you mean a program that refers
to the NSAppleScript class?

What is your command-line environment?  How is it set up?  Double-clicked
app's aren't shell programs, so they don't get env-vars set by your .shrc
file.


A Cocoa+Java application, as built by Xcode, will normally contain the
following in its classpath:
  /System/Library/Java/

A Java Swing application will not.  So if you want it in the classpath, you
have to put it there.

That directory is where the com/apple/... directory is rooted, which is
where the NSAppleScript.class file is located.  Note that the Cocoa-Java
classes are provided as loose class-files, not a jar.

  -- GG


 _______________________________________________
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



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.