google / archive-patcher

Automatically exported from code.google.com/p/archive-patcher
Apache License 2.0
534 stars 74 forks source link

How to run the sample code? #163

Closed fzyzcjy closed 3 years ago

fzyzcjy commented 3 years ago

Hi I am not very familiar with java compilation. Thus I wonder how should I run the code in sample dir? If I directly compile it, java complains that many classes are not defined. I also tried things like javac -cp archive-patcher-1.0.jar ./SamplePatchGenerator.java && java SamplePatchGenerator (with jar downloaded and put in the right location), but still no luck. Thanks!

fzyzcjy commented 3 years ago

OK I get it:

 javac -cp archive-patcher-1.0.jar:. ./SamplePatchGenerator.java && java -cp archive-patcher-1.0.jar:. SamplePatchGenerator
andrewhayden commented 3 years ago

That's one way to do it, certainly, and quite reasonable. The sample code is just here to show you how to write a patch generator and a patch applier. More fully:

To compile and/or run the sample patch generator you would need the "common" and "generator" libraries in your classpath. To compile and/or run the sample patch applier you would need the "common" and "applier" libraries in your classpath. There's no need to deploy the "applier" code on a system that only generates patches (e.g., a server), and no need to deploy the "generator" code on a system that only applies patches (e.g., a client).

fzyzcjy commented 3 years ago

Thank you very much for the detailed answer!

andrewhayden commented 3 years ago

Sure. Please see also https://github.com/google/archive-patcher/issues/16.