Gen generated Java code build fails with "error: <identifier> expected"
search cancel

Gen generated Java code build fails with "error: <identifier> expected"

book

Article ID: 374829

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset

Issue/Introduction

Using Gen 8.6 and generating/installing Java EJB which consumes Action Block from a separate Business System which has its own Java package name ("com.dummy.case.cddummycicsinterfaceservices").

The build fails with this output which indicates the package name has a problem:

    [javac] C:\Users\USERNAME\Documents\CA\Gen 8.6\Models\test.ief\java\com\dummy\case\cddummycicsinterfaceservices\EVCA0010.java:1: error: <identifier> expected
    [javac] package com.dummy.case.cddummycicsinterfaceservices;
    [javac]                   ^
    [javac] C:\Users\USERNAME\Documents\CA\Gen 8.6\Models\test.ief\java\com\dummy\case\cddummycicsinterfaceservices\EVCA0010.java:1: error: class, interface, or enum expected
    [javac] package com.dummy.case.cddummycicsinterfaceservices;
    [javac]                       ^
    [javac] C:\Users\USERNAME\Documents\CA\Gen 8.6\Models\test.ief\java\com\dummy\case\cddummycicsinterfaceservices\EVCA0010.java:1: error: class, interface, or enum expected
    [javac] package com.dummy.case.cddummycicsinterfaceservices;
    [javac]                                          ^

Environment

Gen Build Tool

Cause

The root cause is due to the fact that "case" is a Java reserved word and a reserved word cannot be used in a Java package name.
Reference pages:
Oracle > The Java™ Tutorials > Java Language Keywords
Oracle > The Java™ Tutorials > Packages > Naming a Package

Resolution

Removing the string "case" as a level for the Java package Name resolved the problem.

Additional Information