执行多个 Java 类
目前我有一个包含 6 个类的文件夹。主类称为“交互”。
我使用 javac *.java 编译所有类
我如何运行该程序?当我输入“java Interaction”时,我收到错误,因为其他类没有被加载。好像我需要将其他 4 个类链接到主类中。我该怎么做?
我正在使用 Windows 命令提示符,
谢谢 Philip
我需要将所有程序设置在一个包中吗?
Currently I have a folder with 6 classes. The main class being called "Interaction".
I compile all the classes by using javac *.java
How do I run the program? When I type "java Interaction" I get errors as the other classes are not being loaded. Its as if I need to link the other 4 classes into the main class. How do I do this?
Im using windows command prompt
Thanks
Philip
Do I need to set all the program in a package or something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过在命令提示符下键入“echo %CLASSPATH%”来查看 CLASSPATH 变量。
确保它包含当前目录和任何所需的 jar。
与 Eclipse 使用的进行比较。
Look at the CLASSPATH variable by typing "echo %CLASSPATH%" on the command prompt.
Make sure it includes the current directory and any required jars.
Compare it with the one used by Eclipse.