From cd7ccf44bd825d12fe8a898e2ad465ef8e628cda Mon Sep 17 00:00:00 2001
From: Sven Robertz <sven@cs.lth.se>
Date: Tue, 8 Nov 2011 10:21:41 +0100
Subject: [PATCH] small changes

---
 examples/simple_java/README            | 3 +++
 examples/simple_java/example_encoder.c | 2 ++
 examples/simple_java/run.sh            | 3 ++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/simple_java/README b/examples/simple_java/README
index cbfc280..0b63547 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 079ca17..c620588 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 cd3542d..d37f0a7 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
-- 
GitLab