编译器错误,当文件夹名称包含点 (.) 时。

huangapple 未分类评论47阅读模式
英文:

Compiler error when the folder contains dot (.)

问题

我有一个项目结构如下:

src/main/java
   com
     company.project.utils
            MyClass.java

当我尝试使用以下包时:

package com.company.project.utils;

我在Eclipse中遇到了一个错误,因为它期望结构如下:

src/main/java
   com
     company
         project
             utils
               MyClass.java

问题是我不能更改这个结构,因为有很多类似这样的项目依赖于它。

如果我在Maven中编译这个项目,是没有问题的,而且我的同事在IntelliJ中也没有编译错误。

有没有办法告诉Eclipse,点号是文件夹名称的一部分,而不是一个新的文件夹?

英文:

I have a project structure like :

src/main/java
   com
     company.project.utils
            MyClass.java

When I try to use the package :

package com.company.project.utils;

I got an error in Eclipse because it expects that the structure was :

src/main/java
   com
     company
         project
             utils
               MyClass.java

The problem is that I cant change the structure because there are lots of projects like this and depending of that.

If i compile this project in maven it's ok , also my colleages don't have compiler errors in IntelliJ.

Is there a way to say Eclipse that the dots are part of name folder instead of a new folder ??

huangapple
  • 本文由 发表于 2020年4月10日 00:28:54
  • 转载请务必保留本文链接:https://java.coder-hub.com/61125828.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定