Skip to main content

Cannot enable assertions

1 reply [Last post]
sigmund
Offline
Joined: 2006-09-12

Can assertions be enabled in javac 1.5 or 1.6? The -enableassertions or -ea switch worked in 1.4, but now I get: "Error: javac: invalid flag". I can't find the switch in the specs either.

Regards
Sigmund

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sigmund
Offline
Joined: 2006-09-12

Problem solved: -enableassertions is a runtime flag. (The corresponding compiler flag in 1.4 decided whether to use 'assert' as a keyword or not. Apparently it's always a keyword in 1.5 and above.)

Sigmund