开发者

How to compile many java class?

开发者 https://www.devze.com 2022-12-22 14:41 出处:网络
i got some source code here. the thing is that they are separated to one another. How can i compile them all? 开发者_如何学编程cause im use to compile single class onlyMore than one class means a proj

i got some source code here. the thing is that they are separated to one another. How can i compile them all? 开发者_如何学编程cause im use to compile single class only


More than one class means a project :).

Have you considered using an IDE like Eclipse? Makes life much easier and no need to compile at the console.

You could also use the Ant javac task for example (Ant is a nice build tool, easy to understand and work with).

Or you could resort to a plain javac yourPackage\*.java at the console (javac has lots of options you could use).


javac *.java // or javac find . -name \*.java // then java TheClassWithAMainMethod

ant nice tool to compile many classes


if./src - source dir, ./bin - classes dir

for /r ./src %a in (*.java) do (javac -d ./bin -cp ./bin %a)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号