Xcode 设置编译后运行java显示找不到class

下面来自:https://forums.developer.apple.com/forums/thread/751454


I wan't to use Java in Xcode the class file is Main.class. So I set scheme -> run to a script like this:


#!/bin/sh
java -cp $(dirname $0) Main

But when I run it, java said :


Error: Could not find or load main class Main
Caused by: java.lang.ClassNotFoundException: Main

How can I fix this problem?


And: It's really helpful to answer in Chinese if you know it.



发布日期 2024年5月9日 下午4:39

回复

没有回复。

这个主题已被系统或社区团队关闭。 你可以为你认为有帮助的任何帖子投票,也可以在社区中搜索其他答案。

Xcode 设置编译后运行java显示找不到class

欢迎来到 Apple 支持社区
Apple 客户在其产品方面互相帮助的论坛。使用您的 Apple 帐户开始畅游其中吧!!