如何在 Xcode 中启动 Java 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2034750/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 02:51:09  来源:igfitidea点击:

How to start a Java project in Xcode?

javaxcode

提问by John R Doner

I am currently programming Objective-C in the XcodeIDE, 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.

我目前正在XcodeIDE 中编写 Objective-C ,我知道它也应该支持 Java 项目。当我打开 IDE 并选择 New Project 时,我没有找到任何与 Java 对应的项目模板。我有Snow Leopard,所以我假设我的 Xcode 是最新的。

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

如何在 Xcode IDE 中启动 Java 项目?

采纳答案by mipadi

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.

我想你想要的是一个“JNI 库”项目,它的描述是“这个项目构建了一个带有捆绑应用程序包装器的 Java JNI 库”。在 Xcode 3.2 中,可以在 Mac OS X > Framework & Library > JNI Library 下找到此项目模板。

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

(编辑:这也是 Apple 官方推荐的内容。请参阅此文档。)

回答by David Rodríguez - dribeas

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)

启动 Xcode,选择新项目,向下滚动直到看到 Java 并选择项目类型......并不难(至少在 Xcode 3.0 中)

回答by trashgod

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

作为参考,您将在/Developer/Examples/Java.

回答by TedCHoward

  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"
  1. 打开 Xcode 3.2。
  2. 显示管理器窗口(窗口-> 管理器)。
  3. 单击管理器窗口左下角的“+”按钮。
  4. 选择“从模板新建”->“Java 模板”->“Java 应用程序”

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.

Xcode 依赖 Ant 来构建 Java 项目,因此您可以在管理器窗口中编辑您的代码或使用您希望的任何 IDE 或编辑器。然后只需打开一个终端窗口,切换到文件夹的项目,然后执行 ant。

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

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