现有的 Java 代码库未按目录正确构建。有没有一种工具可以将包分类到适当的目录中?

发布于 2024-08-26 12:24:56 字数 69 浏览 4 评论 0原文

我很高兴安装一个 bash 脚本来执行此操作,但最好有一个自动化工具将 java 文件分类到正确的目录中(在创建它们之后)。

I'm quite happy to rig up a bash script to do this, but it would nice to have an automated tool to sort java files into the correct directories (after creating them).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

荒人说梦 2024-09-02 12:24:56

我能问一下“将java文件排序到正确的目录中(创建它们之后)”是什么意思吗?在Java中如果包结构和目录结构不一样,就不允许编译。

实际上,如果您想组织类,您可以使用 Eclipse IDE(或与此相关的任何其他 IDE)选择一堆类并说“移动”特定的包名称,它会自动将它们移动到适当的包(以及物理包)。目录)

Can I ask what you mean by "sort java files into the correct directories (after creating them)" ? In Java if package structure and directory structure or not same, it wont allow you to compile.

In effect, if you want to organize classes, you use Eclipse IDE (or any other IDE for that matter) select a bunch of classes and say "Move" specificy the package names and it will automatically move them to the appropriate packages (and physical directories)

浅唱ヾ落雨殇 2024-09-02 12:24:56

当文件不在适当的包中时,Eclipse 应该告诉您。
然后,您可以使用问题视图的快速修复选项将文件移动到正确的目录中。

Eclipse should tell you when a file is not in the appropriate package.
You can then use the quick fix option of the problem view to move the files in the right directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文