我知道这个问题现在已经浮出水面了
Xcode 4中的Java.
我不需要任何建议(Eclipse,Netbeans例如)我只想在“XCode4”(而不是3)中编译一些简单的Java代码.我设法创建一个文件,并按预期的语法和一切工作,但编译器由于缺少Scheme.我有点呆在可执行文件上.
我的问题是:
有可能吗?
解决方法
Is it possible to do that?
是的,这是可能的.
1) File > New > New Project > Other > External Build System 2) Give it some name and save it somewhere. 3) File > New > New File > Other > Empty 4) Give it a Java-friendly name. In my example,use "HelloWorld.java" 5) Copy the contents below into the file and save. 6) File > New > New File > Other > Empty 7) Save as "Makefile". 8) Copy the contents below into the file and save. 9) The "Run" (>) button should at least compile your Java now.
现在它变得棘手你不必做下一部分.你可以打开一个终端到你的项目目录,如果你愿意,运行“java HelloWorld”.我强烈建议.您也可以直接输入“make”,并将Xcode纯粹作为文本编辑器使用.
9) Project > Edit Scheme > Debug > Info 10) Executable > Other > type ^⌘g > type "/bin" > choose "sh" 11) Arguments 12) Set "Base Expansion on" whatever you named your target 13) Add an argument '-c "/usr/bin/java -classpath $(PROJECT_DIR) HelloWorld"' for this example. 14) Cross your fingers 15) Click the "Run" (>) button.