gpt4 book ai didi

java - 警告 : [path] the output directory is within an exploded module java 9

转载 作者:行者123 更新时间:2023-12-03 21:24:17 25 4
gpt4 key购买 nike

我正在学习 java 9 模块系统。这是我为管理 java 9 的模块和包而创建的目录。[下面列出的图形图像]

climesoft.widgets [module-1]
com.climesoft.main [module-2]
com.climesoft.math [module-3]
com.climesoft.string [module-4]

当我编译模块 math作为
javac -d mods/com.climesoft.math src/com.climesoft.math/module-info.java src/com.climesoft.math/com/climesoft/math/Math.java
warning: [path] the output directory is within an exploded module: mods/com.climesoft.math
1 warning

我正在尝试将模块输出管理为 mods/module-name/package (即 mods/com.climesoft.math/com/climesoft/math/Math.java )但我面临警告 warning: [path] the output directory is within an exploded module: mods/com.climesoft.math
1 warning

此警告的原因是什么,我该如何解决?我想确认我的目录结构是否适合模块管理?

enter image description here

最佳答案

很久没有问这个问题了,但也许对某人仍然有帮助。我曾经收到同样的警告。 exploded module表示该目录包含模块的解压缩内容。在我的情况下,提供给参数 -d 的父文件夹包含 module-info.java这是在此之前生成的。

┌ C:\dev\java\modules
└> tree /f
C:.
├───bin
│ │ module-info.class <---- this file causes the warning
│ │
│ └───classes <---- target directory in my command
├───lib
│ hello.jar

└───src
│ module-info.java

└───com.example.module.hello
HelloWorld.java

┌ C:\dev\java\modules
└> javac -d bin\classes src\com.example.module.hello\HelloWorld.java
warning: [path] the output directory is within an exploded module: bin\classes
1 warning
就我而言,删除 bin/module-info.class 会有所帮助。并再次运行该命令。

关于java - 警告 : [path] the output directory is within an exploded module java 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49426894/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com