简体   繁体   English

如何使用CMD编译多个java文件?

[英]How do i compile multiple java files using CMD?

I am having problems making my classes see each other when i try to compile using command line. 当我尝试使用命令行编译时,我遇到了让我的类看到对方的问题。

There's about seven java files originally written on NetBeans, all on the same folder. 最初写在NetBeans上的七个java文件都在同一个文件夹中。

When i type javac Main.java, it tells me that it cannot find one of the classes in the same folder. 当我输入javac Main.java时,它告诉我它找不到同一个文件夹中的一个类。

You should be able to use 你应该可以使用

javac *.java

It might be worth noting that globbing will cause that to expand into (assuming your folder has four java files a, b, c and Main), 值得注意的是, globbing将导致扩展为(假设您的文件夹有四个java文件a,b,c和Main),

javac a.java b.java c.java Main.java
javac *.java

要么

javac file1.java file2.java filewhatever.java

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM