jdb not recognizing '--add-reads' option

47 views Asked by At

I'm working on a project where an invocation of a java file is returning a NullPointerException, but I'm not getting any clues as to why, so I'd like to run it through jdb. According to to this page, I should be able to simply replace the call to java with jdb, but when I do, I'm getting the error:

/auto/tools/java/jdk-14.0.1/bin/jdb --add-reads stringtemplate=foostring  -p ./tools/foo:./tools/bar -m foo/com.bar.foo.FOO  -tp ./bar/ -p -o bin/foo -i foo.in

invalid option: --add-reads

Is there a trick I'm missing to allow me to pass all these options to jdb?

1

There are 1 answers

2
user16632363 On

Java commands (java, javac, jdb) do not use the GNU double-dash convention. Use a single dash.

Or if that's an option for the program itself, it should probably come after the class name.