Setting java2metadata property in common.xml

vinceivincei Vincent IbeachumOrganization: Sherman ObservatoryProject: Remote Observatory ControlMember ✭✭
Hi Guys,

I've modified
Ice-3.2.0\demoj\Ice\Invoke sample slightly by adding the following type:
        dictionary<string, double> DoubleDict;
	sequence<DoubleDict>	 DoubleDictSeq;

I then used the supplied ANT build.xml to build the project. During the build I
get the following error:
... DoubleDictSeqHelper.java:39: generic array creation

I've since discovered that, from the command line adding
slice2java --meta java:java2 ...

Produces code that the compiler is happy with.

My question is how or what do I have to do to the build.xml file to ensure that the java2metadata macro in common.xml gets set?
C:\Ice-3.2.0\demoj\Ice\Invoke>java -version
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)

Comments

  • vinceivincei Vincent IbeachumOrganization: Sherman ObservatoryProject: Remote Observatory ControlMember ✭✭
    Thanks!

    -- Vince
  • mesmes CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff
    Hi Vince,

    I believe that the "generic array creation" issue was addressed in Ice 3.2.1. I'd encourage you to use this release instead of 3.2.0 if possible.

    Take care,
    Mark
  • vinceivincei Vincent IbeachumOrganization: Sherman ObservatoryProject: Remote Observatory ControlMember ✭✭
    Hi Mark,

    Once again thanks for the quick response. Moving to Ice-3.2.1 is definitely the
    right thing to do, however, that's turning out to be a hard sell for some reason.

    I'll work on getting the newer version deployed but in the meantime I'll have to
    workaround this problem by using make and not ant build scripts - I can't say I
    fully understand the reason for the existence of ant in the first place ... must
    be a Java thing :D

    I'll circle back on this.

    Take care,
    -- Vince
  • mesmes CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff
    Vince,

    If you always want to build using the Java2 mapping, you can edit config/build.properties and set

    jdk.version=1.4

    Of course this is only relevant for the Ice build system. If you are using the Slice2Java ant task in your own project, you can include a <meta> element like this:
    <slice2java ...>
        <meta value="java:java2"/>
        ...
    </slice2java>
    
    Hope that helps,
    Mark
  • vinceivincei Vincent IbeachumOrganization: Sherman ObservatoryProject: Remote Observatory ControlMember ✭✭
    Hi Mark,

    Thanks! That worked great. Much appreciated.

    Cheers,
    -- Vince
Sign In or Register to comment.