I have created a console app using JCommander. But I don't know how to debug it? What is the approach to debug it?
Asked
Active
Viewed 47 times
1 Answers
0
If you want to debug the parsing itself you should catch the exception thrown by jcommander.
From the Docs:
Whenever JCommander detects an error, it will throw a ParameterException. Note that this is a Runtime Exception, since your application is probably not initialized correctly at this point. Also, ParameterException contains the JCommander instance and you can also invoke usage() on it if you need to display some help.
You can debug the rest of your code like you debug normally.
- Set breakpoints in your IDE and run in debug mode
System.out
's at some points to see whatever your variables contain.

R. Daumann
- 86
- 1
- 6