Unable to get json command line example to work

599 views
Skip to first unread message

ijabz

unread,
Nov 17, 2011, 8:25:28 AM11/17/11
to jsonschema2pojo-users
First problem was that the jsonschema2pojo-cli-0.1.10.jar Manifest
file expects jsonschema2pojo-core-0.1.10.jar to be in lib rather than
the top level folder, so I moved that but now I get this error


c:\Code\\jsonschemapojo>jsonschema2pojo -s address -t output
usage: jsonschema2pojo [-b] [-h] [-p <package name>] -s <arg> -t
<directory>
-b,--generate-builders Generate builder-style methods as well
as
setters
-h,--help Print help information and exit
-p,--package <package name> A java package used for generated types
-s,--source <arg> The source file or directory from which
JSON Schema will be read
-t,--target <directory> The target directory into which
generated
types will be written

output is a folder Ive created, address is the json fikle I downloaded
so I don't understand why it is complaining.

Joe Littlejohn

unread,
Nov 17, 2011, 3:14:41 PM11/17/11
to jsonschema...@googlegroups.com
Hi ijabz,

Thanks for reporting this. I'll fix the script that generates the .zip
download to make sure that the core jar goes into the lib directory.

Regarding your second problem, I'm confused by the behaviour you're
experiencing. At first glance I thought this might be something wrong
with how Windows passed on command line arguments (I'm a Linux user),
but I've tested this on a Windows 7 machine and this works fine for
me. Here's my output:

C:\Users\Administrator\Downloads\jsonschema2pojo-0.1.10>jsonschema2pojo
-s address -t output
Address.java

C:\Users\Administrator\Downloads\jsonschema2pojo-0.1.10>

Maybe you could provide me with a little more information:

1. Which version of Windows are you using?

2. What happens when you invoke the jar directly like:
java -jar jsonschema2pojo-cli-0.1.10.jar -s address -t output

3. What happens when you use the full argument names like:
jsonschema2pojo --source address --target output

Cheers

ijabz

unread,
Nov 17, 2011, 3:47:55 PM11/17/11
to jsonschema2pojo-users

>
> 2. What happens when you invoke the jar directly like:
> java -jar jsonschema2pojo-cli-0.1.10.jar -s address -t output
>
Thats works :)
My bad , when I was trying to solve the issue with cli jar not being
able to find the core jar I modified that batch file adding the -cp
option for classpath, and I think I miessed the script up.
Reply all
Reply to author
Forward
0 new messages