1

Whenever I try to evaluate something with the modulus operator (even something as simple as print 5 % 4) in JDB, I get the error message com.sun.tools.example.debug.expr.ParseException: Unknown operation: % and 5 % 4 = null.

It's only my second time using JDB, so I may be doing something wrong, but I can't find any guidance on what that might be. I definitely did compile my files with the -g option. It looks like a bug in JDB, except I can't find any bug report, and I can't imagine how such an obvious bug would have gotten through. I'm using JDB 1.6 and Java SE 1.7.0_11 under Windows 8. This error happens whether I run JDB from the Windows command prompt or from Cygwin.

tsleyson
  • 319
  • 5
  • 18

1 Answers1

5

If by now you haven't gotten an answer then here goes my suggestion, try compiling using -g: javac -g *.java and then try again to retrieve the value of whatever you need. It worked for me. Regards.

MrCujo
  • 1,218
  • 3
  • 31
  • 56
  • Thanks for your answer. I mentioned in the question that I did compile with the -g flag and was still getting the error. I never did get a solution for this, but I worked around it by importing my code to Netbeans and using its debugger. – tsleyson Feb 23 '15 at 19:04