简体   繁体   English

反编译,编辑和编译.jar文件

[英]Decompile, edit and compile a .jar file

I am working on a program that automaticly decompiles and compiles java programs. 我正在研究一个自动反编译和编译Java程序的程序。 The decompiling works now. 现在,反编译工作正常。 But now i am stuck on the compiling of multiple java files in multiple packages. 但是现在我被困在多个包中的多个Java文件的编译中。 Can anyone help me to find acmd command for compiling a java project? 谁能帮我找到用于编译Java项目的acmd命令?

And if possible make it support external libraries 并尽可能使其支持外部库

I hope i did not make that much grammar mistakes English is not my native language ;-) 我希望我不会犯太多语法错误英语不是我的母语;-)

Lets say you are at the application root folder trying to compile App.java file from com.example package that uses lib1.jar and lib2.jar libraries from lib folder to a destination bin folder, compilation command should have the following format: javac -d bin -sourcepath src -cp lib/lib1.jar;lib/lib2.jar src/com/example/App.java 假设您在应用程序根文件夹中,试图从com.example软件包编译App.java文件,该软件包使用从lib文件夹到目标bin文件夹的lib1.jar和lib2.jar库,编译命令应采用以下格式: javac- d bin -sourcepath src -cp lib / lib1.jar; lib / lib2.jar src / com / example / App.java

So 'bin/com/example/App.class' file should be created. 因此,应创建“ bin / com / example / App.class”文件。 If App.java uses other classes from the project, they all should be automatically compiled and put into corresponding folders. 如果App.java使用项目中的其他类,则应将它们全部自动编译并放入相应的文件夹中。

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

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