diff --git a/examples/simple_java/README b/examples/simple_java/README index cbfc2800e8af7791326016ac12632e1b3f27dfd6..0b63547d75b5db53bbbc081c204558d529912156 100644 --- a/examples/simple_java/README +++ b/examples/simple_java/README @@ -1,3 +1,6 @@ +NB! Before trying to build and run this example, make sure you have built the LabComm compiler +by running "ant jar" in the main directory (../../ seen from here). + This is a very simple example with one labcomm file (simple.lc) defining two samples. Example source code: Encoders and decoders written in Java and C. Encoder.java diff --git a/examples/simple_java/example_encoder.c b/examples/simple_java/example_encoder.c index 079ca17b99b37b3c3e6a64ae7429c29263473518..c62058833d8736bb17dd781f7997041dc903f506 100644 --- a/examples/simple_java/example_encoder.c +++ b/examples/simple_java/example_encoder.c @@ -18,10 +18,12 @@ int main(int argc, char *argv[]) { simple_IntString is; is.x = 24; is.s = "Hello, LabComm!"; + printf("Encoding IntString, x=%d, s=%s\n", is.x, is.s); labcomm_encode_simple_IntString(encoder, &is); simple_TwoInts ti; ti.a = 13; ti.b = 37; + printf("Encoding TwoInts, a=%d, b=%d\n", ti.a, ti.b); labcomm_encode_simple_TwoInts(encoder, &ti); } diff --git a/examples/simple_java/run.sh b/examples/simple_java/run.sh index cd3542dd8a4f12bc3d6fb61c106372dd78e085bb..d37f0a770719c028011c63ca252ba7a476bb4df3 100644 --- a/examples/simple_java/run.sh +++ b/examples/simple_java/run.sh @@ -1,3 +1,4 @@ java -cp .:../../lib/java:gen Encoder encoded_data -java -cp .:../../lib/java:gen Decoder encoded_data ./example_decoder encoded_data +./example_encoder encoded_data +java -cp .:../../lib/java:gen Decoder encoded_data