Home Help Center

assert() in slice2java generated code?

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
_PrinterDisp.java:115: cannot resolve symbol
symbol : method assert (boolean)
location: class atst.cs.demoIce._PrinterDisp
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.



  • SteveWamplerSteveWampler Member ✭✭
    Nevermind - I see I need to add the "-source 1.4" option to javac...

    Sorry to trouble people.
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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
Sign In or Register to comment.