修改java源码解决keys报错
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了修改java源码解决keys报错相关的知识,希望对你有一定的参考价值。
参考技术A 编程错误解决方法Java入门基础第4天《Java编程规范及编译源代码常见错误的解决方法》

爱笑的陈sir
原创
关注
10点赞·484人阅读
大家傍晚好呀!通过学习Java入门基础第3天我们了解了怎么用记事本编写运行Java程序,但是这两天我收到了很多大家的一部分问题?说一下问的最多的吧。如,我的程序运行不了,一行代码,5个报错,编写、编译错误、编码格式错误等等,总之五花八门。
根据所述问题,今天聊聊Java编程规范。方便大家观看,把之前的文章整合了。
Java入门基础第1天(什么是Java?)
Java入门基础第2天(java jdk下载与安装教程)
Java入门基础第3天《使用记事本编写运行Java程序》
Java编程规范及编译源代码常见错误的解决方法
一、编程规范
二、命名规则
三、编码格式规定
四、javac 编译器编译源代码文件常见的问题
五、 解释执行.dass文件常见问题
一、编程规范
我们先简单了解一下什么是编程规范?
编程规范是对编程的一种约定,主要作用是增强代码的可读性和可维护性,便于代码重用
二、命名规则
基本要求是,程序中的各个要素都遵守命名规则,
然后在编码中严格按照编码格式编写代码。
命名规则包括以下几点:
► 包的名称由一个小写字母序列组成。
► 类的名称由大写字母开头,其他字母都由小写的单词组成。
► 类的实例的名称由一个小写字母开头,后面的单词由大写字母开头。
► 常量的名称都大写,并且指出完整含义。 参数的名称无其他具体规定。
► 数组的命名使用“类型[] 数组名”的形式。
三、编码格式规定
► 程序最开始编写导入包和类语句,如 import 语句。
import 语句可以有多行,编写完 import 语句后空一行。
► 定义 public 类,顶格书写。类的主体左括号不换行书写,右括号顶格书写。
► 定义 public 类中的变量,缩进书写。
► 定义方法用缩进书写,方法的左括号不换行书写,右括号和方法首行第一个字符对齐。方法体要再次缩进书写,最后一个变量定义和第一个方法定义之间、方法和方法之间最好空一行。
四、javac 编译器编译源代码文件常见的问题
我们在使用javac 编译器编译源代码时文件时,会出现几个常见的报错问题。
错误描述1、Error:cannot read:HelloJava.java javac。 工具程序找不到指定的 java文件
解决方法:这个需要检查一下你的文件是否存储在当前目录中,或文件名是否错误。
错误描述2、 HelloJava.java:4:class HelloJava is public,should be declared in a file named MyApplication.java。
解决方法:这是你的源文件中类的名称和源文件名称不符,
需要确定源文件名称和类名称是否相同。
错误描述3、 HelloJava.java:6:cannot find symbol。
解决方法:可能是你的源程序文件中某些代码部分输入错了,
最常见的原因可能是没有注意到字母的大小写。
错误描述4、Javac 不是内部或外部命令、可执行程序或批量文件。
解决方法:这是你的 path 设置有误或这你没有在 path 系统变量中加入 JDK 的 bin 目录。
五、 解释执行.dass文件常见问题
我们在解释执行 .dass 文件时,可能会出现以下几个常见的错误报错问题:
错误描述1、 Exception in thread “main” java.lang.NoClassDe£FoundError。
报错出现在Java 工具程序找不到所指定的 .class 类,
需要确定指定的类是否存储在当前目录中,名称是否正确。
错误描述2、 Exception in thread “main” java.lang.NoSuchMetliodError:main。
问题出现在没有指定 Java 程序的入口。
Java 工具程序指定的类必须有一个程序入口,
也就是必须包括 main(String args[]) 这个方法。
鼓励: 如果你觉得博主的文章的不错或者对你有帮助,
可以点一个免费的关注支持一下博主,
如果三连收藏支持就更好了吖,嘿嘿嘿,谢谢。
Datax 源码打包报错与解决方法
打包Datax源码遇到的所有问题与解决方法
文章目录
问题一
一、问题描述
下载Datax源码后,根据
官方文档:
https://github.com/alibaba/DataX/blob/master/userGuid.md
提供的打包命令:
mvn -U clean package assembly:assembly -Dmaven.test.skip=true
执行打包命令报错:Failed to execute goal on project hdfsreader: Could not resolve dependencies for project com.alibaba.datax:hdfsreader:jar:0.0.1-SNAPSHOT: Failed to collect dependencies
maven的setting.xml中mirror配置如下
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
<mirror>
<id>repo1</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>
<mirror>
<id>repo2</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://repo2.maven.org/maven2/</url>
</mirror>
<mirror>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</mirror>
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云spring插件仓库</name>
<url>https://maven.aliyun.com/repository/spring-plugin</url>
</mirror>
<mirror>
<id>repo3</id>
<mirrorOf>central</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>https://maven.aliyun.com/repository/spring-plugin</url>
</mirror>
<mirror>
<id>repo4</id>
<mirrorOf>central</mirrorOf>
<name>Spring Milestones</name>
<url>https://repo.spring.io/plugins-release/</url>
</mirror>
报错日志如下:
[INFO] Reactor Summary:
[INFO]
[INFO] datax-all 0.0.1-SNAPSHOT ........................... SUCCESS [ 0.060 s]
[INFO] datax-common 0.0.1-SNAPSHOT ........................ SUCCESS [ 1.253 s]
[INFO] datax-transformer 0.0.1-SNAPSHOT ................... SUCCESS [ 2.051 s]
[INFO] datax-core 0.0.1-SNAPSHOT .......................... SUCCESS [ 5.294 s]
[INFO] plugin-rdbms-util 0.0.1-SNAPSHOT ................... SUCCESS [ 0.731 s]
[INFO] mysqlreader 0.0.1-SNAPSHOT ......................... SUCCESS [ 2.573 s]
[INFO] drdsreader 0.0.1-SNAPSHOT .......................... SUCCESS [ 2.576 s]
[INFO] sqlserverreader 0.0.1-SNAPSHOT ..................... SUCCESS [ 2.478 s]
[INFO] postgresqlreader 0.0.1-SNAPSHOT .................... SUCCESS [ 2.682 s]
[INFO] kingbaseesreader 0.0.1-SNAPSHOT .................... SUCCESS [ 2.461 s]
[INFO] oraclereader 0.0.1-SNAPSHOT ........................ SUCCESS [ 2.522 s]
[INFO] odpsreader 0.0.1-SNAPSHOT .......................... SUCCESS [ 4.557 s]
[INFO] otsreader 0.0.1-SNAPSHOT ........................... SUCCESS [ 4.408 s]
[INFO] otsstreamreader 0.0.1 .............................. SUCCESS [ 4.277 s]
[INFO] plugin-unstructured-storage-util 0.0.1-SNAPSHOT .... SUCCESS [ 0.636 s]
[INFO] txtfilereader 0.0.1-SNAPSHOT ....................... SUCCESS [ 11.641 s]
[INFO] hdfsreader 0.0.1-SNAPSHOT .......................... FAILURE [ 25.316 s]
[INFO] streamreader 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] ossreader 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] ftpreader 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] mongodbreader 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] rdbmsreader 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] hbase11xreader 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] hbase094xreader 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] tsdbreader 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] opentsdbreader 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] cassandrareader 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] gdbreader 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] oceanbasev10reader 0.0.1-SNAPSHOT .................. SKIPPED
[INFO] mysqlwriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] drdswriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] odpswriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] txtfilewriter 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] ftpwriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] hdfswriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] streamwriter 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] otswriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] oraclewriter 0.0.1-SNAPSHOT ........................ SKIPPED
[INFO] sqlserverwriter 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] postgresqlwriter 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] kingbaseeswriter 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] osswriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] mongodbwriter 0.0.1-SNAPSHOT ....................... SKIPPED
[INFO] adswriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] ocswriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] rdbmswriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] hbase11xwriter 0.0.1-SNAPSHOT ...................... SKIPPED
[INFO] hbase094xwriter 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] hbase11xsqlwriter 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] hbase11xsqlreader 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] elasticsearchwriter 0.0.1-SNAPSHOT ................. SKIPPED
[INFO] tsdbwriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] adbpgwriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] gdbwriter 0.0.1-SNAPSHOT ........................... SKIPPED
[INFO] cassandrawriter 0.0.1-SNAPSHOT ..................... SKIPPED
[INFO] clickhousewriter 0.0.1-SNAPSHOT .................... SKIPPED
[INFO] oscarwriter 0.0.1-SNAPSHOT ......................... SKIPPED
[INFO] oceanbasev10writer 0.0.1-SNAPSHOT .................. SKIPPED
[INFO] hbase20xsqlreader 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] hbase20xsqlwriter 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] kuduwriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:16 min
[INFO] Finished at: 2021-06-16T15:40:42+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hdfsreader: Could not resolve dependencies for project com.alibaba.datax:hdfsreader:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.apache.hive:hive-exec:jar:1.1.1 -> org.apache.calcite:calcite-core:jar:1.0.0-incubating -> org.pentaho:pentaho-aggdesigner-algorithm:jar:5.1.5-jhyde: Failed to read artifact descriptor for org.pentaho:pentaho-aggdesigner-algorithm:jar:5.1.5-jhyde: Could not transfer artifact org.
pentaho:pentaho-aggdesigner-algorithm:pom:5.1.5-jhyde from/to repo1 (http://repo1.maven.org/maven2/): Transfer failed for http://repo1.maven.org/maven2/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/pentaho-aggdesigner-algori
thm-5.1.5-jhyde.pom 501 HTTPS Required -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :hdfsreader
二、解决
1 google搜索报错
找到一个相关Issue,并没有解决方案
https://github.com/alibaba/DataX/issues/704
找到一个教程,让在setting.xml里加几个mirror
https://www.programmersought.com/article/25773844741/
照着加上,还是找不到jar包
2 检查本地仓库
看到底是哪个jar包没下载下来
依次检查,发现只有pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar这个jar包没下载下来
google搜索这个jar包,发现maven仓库有,手动下载提示输入用户名密码,找了一下注册登录(下载jar还需要登录真是无fuck说),没找到。
2.1 下载jar包
经过不懈的寻找,终于在另外一个提供jar包下载的网站找到这个jar。
https://javalibs.com/artifact/org.pentaho/pentaho-aggdesigner-algorithm
2.2 将下载好的jar包放到本地仓库jar包对应目录下
比如我的本地仓库是
// 本地仓库路径
D:\\data\\mvn_repository
// 放jar包的路径
D:\\data\\mvn_repository\\org\\pentaho\\pentaho-aggdesigner-algorithm\\5.1.5-jhyde
2.3 将jar包目录下除jar包之外的其他文件删除
2.4 新建pom文件
继续打开这个url
https://javalibs.com/artifact/org.pentaho/pentaho-aggdesigner-algorithm
点击Download可以看到下图所示的内容
点击pom,会出现如下内容
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.pentaho</groupId>
<artifactId>pentaho-aggdesigner-algorithm</artifactId>
<version>5.1.5-jhyde</version>
<description>POM was created by Sonatype Nexus</description>
</project>
- 新建一个名为
pentaho-aggdesigner-algorithm-5.1.5-jhyde.pom
的文件 - 用文本编辑器打开文件
- 复制上面的pom内容,粘贴到文件里,保存
现在jar包所在目录应该像这样
继续执行打包命令
发现hdfsreader已经可以打包成功
执行到打包oscarwrite时又报了第二个错
问题二
一、问题描述
执行打包命令报错:
Failed to execute goal on project oscarwriter: Could not resolve dependencies for project com.alibaba.datax:oscarwriter:jar:0.0.1-SNAPSHOT: Could not find artifact com.oscar:oscar:jar:7.0.8
日志
[INFO] Reactor Summary:
[INFO]
[INFO] datax-all 0.0.1-SNAPSHOT ........................... SUCCESS [ 0.060 s]
[INFO] datax-common 0.0.1-SNAPSHOT ........................ SUCCESS [ 1.264 s]
[INFO] datax-transformer 0.0.1-SNAPSHOT ................... SUCCESS [ 2.045 s]
[INFO] datax-core 0.0.1-SNAPSHOT .......................... SUCCESS [ 5.495 s]
[INFO] plugin-rdbms-util 0.0.1-SNAPSHOT ................... SUCCESS [ 0.720 s]
[INFO] mysqlreader 0.0.1-SNAPSHOT ......................... SUCCESS [ 2.584 s]
[INFO] drdsreader 0.0.1-SNAPSHOT .......................... SUCCESS [ 2.617 s]
[INFO] sqlserverreader 0.0.1-SNAPSHOT ..................... SUCCESS [ 2.509 s]
[INFO] postgresqlreader 0.0.1-SNAPSHOT .................... SUCCESS [ 2.730 s]
[INFO] kingbaseesreader 0.0.1-SNAPSHOT .................... SUCCESS [ 2.486 s]
[INFO] oraclereader 0.0.1-SNAPSHOT ........................ SUCCESS [ 2.531 s]
[INFO] odpsreader 0.0.1-SNAPSHOT .......................... SUCCESS [ 4.637 s]
[INFO] otsreader 0.0.1-SNAPSHOT ........................... SUCCESS [ 4.472 s]
[INFO] otsstreamreader 0.0.1 .............................. SUCCESS [ 4.335 s]
[INFO] plugin-unstructured-storage-util 0.0.1-SNAPSHOT .... SUCCESS [ 0.658 s]
[INFO] txtfilereader 0.0.1-SNAPSHOT ....................... SUCCESS [ 11.636 s]
[INFO] hdfsreader 0.0.1-SNAPSHOT .......................... SUCCESS [ 31.336 s]
[INFO] streamreader 0.0.1-SNAPSHOT ........................ SUCCESS [ 2.017 s]
[INFO] ossreader 0.0.1-SNAPSHOT ........................... SUCCESS [ 12.163 s]
[INFO] ftpreader 0.0.1-SNAPSHOT ........................... SUCCESS [ 11.482 s]
[INFO] mongodbreader 0.0.1-SNAPSHOT ....................... SUCCESS [ 11.661 s]
[INFO] rdbmsreader 0.0.1-SNAPSHOT ......................... SUCCESS [ 2.555 s]
[INFO] hbase11xreader 0.0.1-SNAPSHOT ...................... SUCCESS [ 12.942 s]
[INFO] hbase094xreader 0.0.1-SNAPSHOT ..................... SUCCESS [ 11.717 s]
[INFO] tsdbreader 0.0.1-SNAPSHOT .......................... SUCCESS [ 2.798 s]
[INFO] opentsdbreader 0.0.1-SNAPSHOT ...................... SUCCESS [ 6.044 s]
[INFO] cassandrareader 0.0.1-SNAPSHOT ..................... SUCCESS [ 5.355 s]
[INFO] gdbreader 0.0.1-SNAPSHOT ........................... SUCCESS [ 10.133 s]
[INFO] oceanbasev10reader 0.0.1-SNAPSHOT .................. SUCCESS [ 2.919 s]
[INFO] mysqlwriter 0.0.1-SNAPSHOT ......................... SUCCESS [ 2.545 s]
[INFO] drdswriter 0.0.1-SNAPSHOT .......................... SUCCESS [ 2.533 s]
[INFO] odpswriter 0.0.1-SNAPSHOT .......................... SUCCESS [ 4.515 s]
[INFO] txtfilewriter 0.0.1-SNAPSHOT ....................... SUCCESS [ 11.471 s]
[INFO] ftpwriter 0.0.1-SNAPSHOT ........................... SUCCESS [ 11.544 s]
[INFO] hdfswriter 0.0.1-SNAPSHOT .......................... SUCCESS [ 23.885 s]
[INFO] streamwriter 0.0.1-SNAPSHOT ........................ SUCCESS [ 1.850 s]
[INFO] otswriter 0.0.1-SNAPSHOT ........................... SUCCESS [ 4.381 s]
[INFO] oraclewriter 0.0.1-SNAPSHOT ........................ SUCCESS [ 2.531 s]
[INFO] sqlserverwriter 0.0.1-SNAPSHOT ..................... SUCCESS [ 2.547 s]
[INFO] postgresqlwriter 0.0.1-SNAPSHOT .................... SUCCESS [ 2.651 s]
[INFO] kingbaseeswriter 0.0.1-SNAPSHOT .................... SUCCESS [ 2.500 s]
[INFO] osswriter 0.0.1-SNAPSHOT ........................... SUCCESS [ 12.018 s]
[INFO] mongodbwriter 0.0.1-SNAPSHOT ....................... SUCCESS [ 12.132 s]
[INFO] adswriter 0.0.1-SNAPSHOT ........................... SUCCESS [ 8.309 s]
[INFO] ocswriter 0.0.1-SNAPSHOT ........................... SUCCESS [ 4.925 s]
[INFO] rdbmswriter 0.0.1-SNAPSHOT ......................... SUCCESS [ 2.664 s]
[INFO] hbase11xwriter 0.0.1-SNAPSHOT ...................... SUCCESS [ 13.108 s]
[INFO] hbase094xwriter 0.0.1-SNAPSHOT ..................... SUCCESS [ 11.841 s]
[INFO] hbase11xsqlwriter 0.0.1-SNAPSHOT ................... SUCCESS [ 23.918 s]
[INFO] hbase11xsqlreader 0.0.1-SNAPSHOT ................... SUCCESS [ 24.070 s]
[INFO] elasticsearchwriter 0.0.1-SNAPSHOT ................. SUCCESS [ 3.759 s]
[INFO] tsdbwriter 0.0.1-SNAPSHOT .......................... SUCCESS [ 2.525 s]
[INFO] adbpgwriter 0.0.1-SNAPSHOT ......................... SUCCESS [ 5.888 s]
[INFO] gdbwriter 0.0.1-SNAPSHOT ........................... SUCCESS [ 5.877 s]
[INFO] cassandrawriter 0.0.1-SNAPSHOT ..................... SUCCESS [ 5.032 s]
[INFO] clickhousewriter 0.0.1-SNAPSHOT .................... SUCCESS [ 5.627 s]
[INFO] oscarwriter 0.0.1-SNAPSHOT ......................... FAILURE [ 0.007 s]
[INFO] oceanbasev10writer 0.0.1-SNAPSHOT .................. SKIPPED
[INFO] hbase20xsqlreader 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] hbase20xsqlwriter 0.0.1-SNAPSHOT ................... SKIPPED
[INFO] kuduwriter 0.0.1-SNAPSHOT .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:29 min
[INFO] Finished at: 2021-06-16T16:44:38+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project oscarwriter: Could not resolve dependencies for project com.alibaba.datax:oscarwriter:jar:0.0.1-SNAPSHOT: Could not find artifact com.oscar:oscar:jar:7.0.8 at specified path D:\\os_ws\\DataX\\o
scarwriter\\src\\main\\lib\\oscarJDBC.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :oscarwriter
二、解决
google搜jar包名字
发现一个datax的issue,下面有兄弟说如果没用到这个可以注释掉,就不会打这个包了
https://github.com/alibaba/DataX/issues/962
1 修改项目的pom.xml
找到项目根目录下的pom.xml,用文本编辑器打开文件,搜索oscar,将oscar有关的注释掉
如图所示
2 修改package.xml
找到项目根目录下的package.xml,用文本编辑器打开文件,搜索oscar,将oscar有关的注释掉
如图所示
重新执行打包命令
终于打包成功
以上是关于修改java源码解决keys报错的主要内容,如果未能解决你的问题,请参考以下文章
错误记录IntelliJ IDEA 中右键点击源码目录选择 New 选项 没有创建 Java Class 选项 ( 将对应的源码目录标记为 Sources 选项 )