非常基本的Java程序错误(“ Hello world”)[关闭]

问题描述 投票:0回答:1
在我的程序中,我希望它输出“ hello world”。它显示“ args”部分的错误。我的文件名为“ Trial1”。另外,我使用的是eclispe工作区,但我不太了解如何才能在上面播放程序。有任何想法吗?请帮忙谢谢

public class Trial1 { public static void main(String[] args) { System.out.println("Hello World"); } }

java
1个回答
2
投票
似乎没有错误,我已经使用Eclips运行了Java 8 enter image description here

[注意事项-如果您正在使用Eclips; (您将看到没有配置此错误的错误)

1。

尝试创建不带以下图像的类时(有时它不会在项目配置中添加主方法,类),那么您必须手动添加它enter image description here

2。

可以验证它。右键单击项目>转到运行方式>单击运行配置,您可以看到下图所示的详细信息enter image description here
© www.soinside.com 2019 - 2024. All rights reserved.