Clean Build Java Command Line

♀尐吖头ヾ 提交于 2019-12-11 01:22:26

问题


I am compiling my project written using eclipse using the command line as follows

javac file.java

And then to run:

java file (args here)

How would I run a clean build, or compilation? Whenever I recompile, the changes are not getting affected unless I delete all the .class files and recompile. Please note that the the main file will call other classes too.

Thanks


回答1:


You should compile all the Java files in your application to be sure, basically.

Options include:

  • Use a full build system such as Ant.
  • On a Unix box, use something like:

    javac `find . -name '*.java'`
    

    assuming you don't have too many (or use xargs if necessary).

  • If you're not using packages (and you really should be) you can just use:

    javac *.java
    


来源:https://stackoverflow.com/questions/7339886/clean-build-java-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!