Java is generated from the same ../schema/lwep.proto as Python and nanopb.
It is not part of the live TCP tester; this is a smoke check that the schema
produces a cross-language-compatible wire format.
protocon PATHprotobuf-java-<version>.jarmatching yourprotoc(e.g. protoc 35.1 →protobuf-java-4.35.1.jarfrom Maven Central). Set$PB_JARbelow.curl -sSLO https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/4.35.1/protobuf-java-4.35.1.jar
- a JDK (
javac,java) — validated with Temurin JDK 17
On MSYS2, convert the jar path to Windows form for Java:
PB_JAR=$(cygpath -w /path/to/protobuf-java-4.35.1.jar)(Java doesn't understand/c/...MSYS paths).
# from this folder
protoc --proto_path=..\schema --java_out=. ..\schema\lwep.proto
# -> ./lwep/Lwep.java (git-ignored)javac -cp "$PB_JAR" lwep/Lwep.java Example.java
java -cp ".:$PB_JAR" Example # Windows: use ';' instead of ':'
# -> writes sensor.binDecode the Java-produced bytes with the Python bindings:
import sys; sys.path.insert(0, "../python")
import lwep_pb2
m = lwep_pb2.SensorReading()
m.ParseFromString(open("sensor.bin", "rb").read())
print(m) # should show id=4097, label="cabin-temp", value=23.5, ...Matching output confirms Java and Python agree on the same neutral schema.