java - 在 Debian 10 中执行 Java 时遇到问题
问题描述
大家,我在Debian 10中执行Java时遇到了麻烦
package ddd;
class Clothes {
String color;
char size;
}
public class Field {
public static void main(String[] args) {
Clothes sun = new Clothes();
Clothes spring = new Clothes();
sun.color = "red";
sun.size = 'S';
spring.color = "green";
spring.size = 'M';
System.out.printf("sun (%s, %c)%n", sun.color, sun.size);
System.out.printf("spring (%s, %c)%n", spring.color, spring.size);
}
}
当我执行它时,系统返回了一个错误:
error: can't find main(String[]) method in class: ddd.Clothes
有人能弄清楚发生了什么吗?
解决方案
推荐阅读
- linux - 使用 CMake 将共享库包含到 Linux 应用程序中 – GCC 链接器错误
- c# - C# 中的 ISO 8859 编码
- phpword - 在 PHPWord 中编码 HTML 实体
- r - 将数据框转换为多个重叠列形成一个比例?
- python - Removing the texts within a comment block ?* */ in python
- angular - Angular 6 / 7“依赖的结果是一个表达式”
- php - laravel 5.6未定义变量:尝试发送电子邮件时的用户
- reactjs - 未处理的承诺拒绝警告:
- msbuild - 如何通过 MsBuild 将所有 json 文件复制到新文件夹?
- python - 用户输入需要 int 但接受变量名