How to compile a single Java file

后端 未结 2 909
傲寒
傲寒 2020-12-13 04:26

I have searched this, but I could\'n find or understand what I found.
Now I\'m not a Java programmer, but I have the need to compile a single Java file into an existing

2条回答
  •  悲哀的现实
    2020-12-13 05:24

    As far as I can understand you want to re-compile a single java file and replace it in an existing jar file..

    So you compile it..

    cmd>javac -classpath jar1.jar;jar2.jar my.company.MyClassToReplace.java

    and replace it in the jar.

    cmd>jar uf myJarFile.jar my/company/MyClassToReplace.class

提交回复
热议问题