Archived
This forum has been archived. Please start a new discussion on GitHub.
Setting java2metadata property in common.xml
Hi Guys,
I've modified
Ice-3.2.0\demoj\Ice\Invoke sample slightly by adding the following type:
I then used the supplied ANT build.xml to build the project. During the build I
get the following error:
I've since discovered that, from the command line adding
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?
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)
0
Comments
-
Thanks!
-- Vince0 -
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,
Mark0 -
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
I'll circle back on this.
Take care,
-- Vince0 -
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,
Mark0 -
Hi Mark,
Thanks! That worked great. Much appreciated.
Cheers,
-- Vince0