为了账号安全,请及时绑定邮箱和手机立即绑定

mvn jetty:run 运行出现错误

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building spring-mvc-study Maven Webapp 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] >>> jetty-maven-plugin:9.2.2.v20140723:run (default-cli) @ spring-mvc-study >>>

[INFO]

[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ spring-mvc-study ---

[debug] execute contextualize

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] Copying 1 resource

[INFO]

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ spring-mvc-study ---

[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!

[INFO] Compiling 5 source files to D:\Code\imooc\spring-mvc-study\target\classes

[INFO] -------------------------------------------------------------

[ERROR] COMPILATION ERROR :

[INFO] -------------------------------------------------------------

[ERROR] \Code\imooc\spring-mvc-study\src\main\java\com\imooc\mvcdemo\service\impl\CourseServiceImpl.java:[1,0] : Ҫclass, interfaceenum

[INFO] 1 error

[INFO] -------------------------------------------------------------

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.100s

[INFO] Finished at: Tue Mar 03 17:47:19 CST 2020

[INFO] Final Memory: 8M/229M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project spring-mvc-study: Compilation failure

[ERROR] \Code\imooc\spring-mvc-study\src\main\java\com\imooc\mvcdemo\service\impl\CourseServiceImpl.java:[1,0] : Ҫclass, interfaceenum

[ERROR] -> [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/MojoFailureException


正在回答

1 回答

已解决

在pom.xml中添加

<dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>2.3.2</version>
</dependency>

之后还会出现由于用IDEA打开eclipse java项目编译时,出现以下错误:

Error:(1, 1) java: 非法字符: ‘\ufeff’ 
Error:(1, 10) java: 需要class, interface或enum

点击指定的工程,右键,“Remove BOM”

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Spring MVC起步
  • 参与学习       195980    人
  • 解答问题       572    个

Java中Spring MVC框架入门教程,快来看最易用的MVC框架

进入课程

mvn jetty:run 运行出现错误

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信