John R Doner
John R Doner

Reputation: 2282

How to start a Java project in Xcode?

I am currently programming Objective-C in the Xcode IDE, and I understand it should also support Java projects. When I open the IDE and choose New Project, I don't find any project templates that correspond to Java. I have Snow Leopard, so I assume my Xcode is up-to-date.

How do I start a Java project in the Xcode IDE?

Upvotes: 7

Views: 78116

Answers (4)

mipadi
mipadi

Reputation: 411370

I think what you want is a "JNI Library" project, which has the description "This project builds a Java JNI library with a bundled application wrapper." In Xcode 3.2, this project template can be found under Mac OS X > Framework & Library > JNI Library.

(Edit: This is what Apple officially recommends, too. See this document.)

Upvotes: 5

TedCHoward
TedCHoward

Reputation: 141

  1. Open Xcode 3.2.
  2. Show the Organizer window (Window->Organizer).
  3. Click the '+' button in the lower left corner of the Organizer window.
  4. Choose "New From Template"->"Java Templates"->"Java Application"

Xcode relies on Ant to build Java projects, so you can edit your code in the organizer window or use whatever IDE or editor you wish. Then just open a terminal window, change to the folder's project, and execute ant.

http://developer.apple.com/mac/library/documentation/Java/Conceptual/Java14Development/02-JavaDevTools/JavaDevTools.html

Upvotes: 2

trashgod
trashgod

Reputation: 205875

For reference, you'll find several example projects in /Developer/Examples/Java.

Upvotes: 0

Fire up Xcode, select new project, scroll down until you see Java and select the type of project... not that hard (at least with Xcode 3.0)

Upvotes: 0

Related Questions