zoukankan      html  css  js  c++  java
  • 解决: maven编译项目报“非法字符: 65279 ”错误

    打包maven项目的时候,出现异常:

    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.303s
    [INFO] Finished at: Fri Sep 09 12:57:08 CST 2016
    [INFO] Final Memory: 11M/150M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project common-test-webapp: Compilation failure: Compilation failure:
    [ERROR] H:devsourceworkspacecommon-test-webappsrcmainjavacom	estutilGetPy.java:[1,0] 错误: 非法字符: 65279
    [ERROR] H:devsourceworkspacecommon-test-webappsrcmainjavacom	estutilGetPy.java:[1,9] 错误: 需要class, interface或enum
    [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

    打开文件H:devsourceworkspacecommon-test-webappsrcmainjavacom estutilGetPy.java,发现里面并没有什么错误,在eclipse里也没有报错,是什么原因呢?

    出现这种错误的原因大概有几种情况:

    1、操作系统的原因,操作系统不同,出现了一些不可见字符。

    2、某些编辑工具的原因,编辑工具自己默认添加了一些不可见字符。

    快速解决方法:备份原有文件后,删除该文件,重新建立一个空白文件,将原文件内容复制到新文件中即可。

  • 相关阅读:
    Kubernetes Admission Controller解析
    容器化Node Exporter对主机磁盘使用率的监控问题
    Prometheus监控指标的label注入方法
    Prometheus告警模型分析
    Kubernetes Controller执行框架解析
    深入理解Istio核心组件之Pilot
    Prometheus存储模型分析
    如何利用Prometheus监控你的应用
    Prometheus在Kubernetes下的服务发现机制
    JSON字符串和js对象转换
  • 原文地址:https://www.cnblogs.com/jessezeng/p/5857727.html
Copyright © 2011-2022 走看看