Women in Technology

Hear us Roar

  Building Cocoa-Java Apps with Eclipse
Subject:   Having a problem setting up Debugging
Date:   2006-07-20 19:52:42
From:   meclyma
Response to: Having a problem setting up Debugging


I found the original Controller.java file. I copied the code into a new file under the TextEdit folder in Eclipse (it was placed under a default package). Then I received several errors in Controller.java. Here are a few of the lines with errors:

    Under applicationShouldTerminate method:

Document document = Document.documentForWindow(window);
The error is on "Document"

The error is on "Preferences"

    Under applicationOpenFile method:

return Document.openDocumentWithURL(NSPathUtilities.URLWithPath(filename),
The error is on "Document" (there are other errors on this line that I won't list here).

There are more errors in Controller.java that I will not list here because they are similar errors. I am not sure if all of these errors are part of JAVA classes or Cocoa classes (I suspect Cocoa classes). Do I need to add more "import"'s to Controller.java? Or do I need to tell Eclipse where to find the Cocoa library? If the latter, is this because I created a new Java file and copied the code into a new file that Eclipse is confused on (and obviously this developer too)? In your article you showed us how to tell Eclipse where to find the Cocoa classes by creating a

folder called "Cocoa". But how do you link a newly created Java file to the Cocoa classes when the Cocoa folder already exists?

BTW, I forgot to mention that I am using: Eclipse 3.2.0, MacOS X 10.4.6, Xcode 2.3, and JAVA 1.5.



Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Having a problem setting up Debugging
    2006-07-21 02:40:02  mikebutler1 [View]

    Hi Mark,

    It looks like you're nearly there ( but why did you have to copy the code from Controller.java? Why not just use Controller.java? ). It just looks like you haven't told Eclipse where to find all of the Cocoa classes.

    If you follow steps 5 and 6 of "Tell Eclipse where to find the Cocoa classes" on page one, then it should sort it out for you. Those steps describe how to get Eclipse to add an external class folder - in this case /System/Library/Java where all of the Cocoa classes are stored.

    Hope that helps,