ZeroC

Archived

This forum has been archived. Please start a new discussion on GitHub.

assert() in slice2java generated code?

SteveWampler
SteveWampler
I'm trying to compile the simple Printer.ice example from the manual using JDK 1.4.2 (Redhat
Linux 9.0) and ICE 1.3.0. I get:
weaver% javac -extdirs /opt/atst/lib/Java/ext *.java
_PrinterDisp.java:115: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier
assert(false);
^
_PrinterDisp.java:115: cannot resolve symbol
symbol : method assert (boolean)
location: class atst.cs.demoIce._PrinterDisp
assert(false);
^
1 error
1 warning

(The Ice.jar and db.jar files are symlinked into the /opt/atst/lib/Java/ext directory.)

Is this to be expected? What should I do to fix it? I don't remember a problem with 1.2.0.

Thanks!
Steve

Comments

  • SteveWampler
    SteveWampler
    Nevermind - I see I need to add the "-source 1.4" option to javac...

    Sorry to trouble people.
  • mes
    mes California
    Hi Steve,

    This is expected. You need to add the options -source 1.4 in order to enable compiler support for the assert keyword.

    Take care,
    - Mark