capnproto-java icon indicating copy to clipboard operation
capnproto-java copied to clipboard

need better setup documentation

Open dwrensha opened this issue 9 years ago • 5 comments

For example, where is java.capnp?

dwrensha avatar Feb 08 '15 01:02 dwrensha

To answer that specific question: you can tell the schema compiler where to find java.capnp by invoking it like this: capnp compile -I compiler/src/main/schema. Alternatively, you could copy java.capnp into the installed capnp include directory, where you will also find schema.capnp and c++.capnp.

Does that clear things up? What else is causing trouble? (These questions are specifically addressed to Luc Perkins, who initially raised this issue on Twitter, but anyone else should feel welcome to chime in!)

dwrensha avatar Feb 08 '15 01:02 dwrensha

Hi, I followed your suggestions and copied java.capnp onto the include dir and now I get

capnp compile -ojava addressbook.capnp                                                                                                                   
java: no such plugin (executable should be 'capnpc-java')
java: plugin failed: exit code 1

mfirry avatar Feb 16 '15 07:02 mfirry

Hi @mfirry. Using the -ojava flag like that will only work if capnpc-java is in your current directory or in your PATH. You can instead invoke it like capnp compile -o/path/to/capnpc-java.

See capnp compile --help.

dwrensha avatar Feb 16 '15 17:02 dwrensha

Great. Thanks!

mfirry avatar Feb 16 '15 20:02 mfirry

I was receiving the same error as @mfirry, and using the capnp compile -o/path/to/capnpc-java did not work for me.

However, placing capnpc-java and the .cpnp source file in the same directory and using

capnp compile -o./capnpc-java mySourceFile.capnp

Did the trick!

Hopefully someone else struggling with this issue finds this useful.

jalbatross avatar Jun 28 '17 17:06 jalbatross