【发布时间】:2023-01-16 00:32:31
【问题描述】:
我用 intelliJ 开发了一个 Java 项目,现在我想通过命令行运行我的程序。所以我转到 project/out/production/project 文件夹,我的 *.class 文件所在的位置并尝试运行我的文件“java FileCopy [args]”(FileCopy.class 在那里,里面的类具有相同的名称)但是我收到错误消息“Fehler:无法找到或加载主类 FileCopy Ursache:java.lang.NoClassDefFoundError:BelegFileTransfer/FileCopy(错误名称:FileCopy)”
如果我想用 intelliJ 运行我的项目,没问题。
我究竟做错了什么?
我的目录结构:
FileTransfer
-> .idea
-> out
--> production
----> FileTransfer (thats where the .class files located and i am running the cmd)
-> src
--> FileTransfer (thats where the .java files located)
【问题讨论】:
-
很难知道您的文件在哪里以及存在哪些包。请发帖(格式化为代码) 输出以下内容,已更改为目录 BelegDateitransferNeu(我无法正确发布路径,因为你发布了一张图片 - 请学习从 cmd.exe 复制粘贴)。命令
dir /s/b