Contracts are not being checked

57 views
Skip to first unread message

Bharat Jayaraman

unread,
Nov 4, 2018, 9:49:32 PM11/4/18
to cofoja
I use Cofoja in an OOAD course that I teach at SUNY Buffalo.   Last year I installed Cofoja on Eclipse (Neon) IDE for Java Developers, and it worked fine.  

This year I am using Eclipse Photon and Java 8.   Today I installed the Java 8 version (cofoja+asm) posted at


Installation went fine, and there were no errors with any of the contracts, but the contracts are not being checked at run-time.  

There was an earlier posting entitled "Preconditions are never executed".   In my case, neither preconditions nor postconditions are being executed.  I did not see any reply or follow up to that posting.

Any suggestions would be appreciated, as I would like to continue using Cofoja for my classes.

Thank you.

Bharat

Bharat Jayaraman

unread,
Nov 5, 2018, 6:21:08 PM11/5/18
to cofoja
Upon further investigation, I found that the cause of the problem was a java.io.IOException:

no system JavaCompiler found; are you using a JRE instead of a JDK?

The problem was easily solved by adding JDK to the Java BuildPath under Properties.   Somehow, this step was unnecessary for Eclipse Neon.

I hope this posting is useful for others who might run into this problem.

- Bharat

Bharat Jayaraman

unread,
Nov 5, 2018, 6:24:22 PM11/5/18
to cofoja
I should have added that the IOException is not reported on the Console but was occurring somewhere inside and being masked at the top-level.   Was able to detect this problem through one of the occasional pop-up messages from Eclipse.
- BJ
Reply all
Reply to author
Forward
0 new messages