generics not supported in -source 1.3 ?

in Help Center
Hi, being a newbie to Ice, when i run the ant command for the IceEJ demoproject "hello" i receive this output:
What shall i do?
What shall i do?
C:\IceEJ-1.1.0\demo\IceE\midp\hello>ant Buildfile: build.xml config-init: init: generate: [mkdir] Created dir: C:\IceEJ-1.1.0\demo\IceE\midp\hello\generated [slice2javae] C:\Ice-3.2.0\bin\slice2javae --output-dir C:\IceEJ-1.1.0\demo\Ice E\midp\hello\generated C:\IceEJ-1.1.0\demo\IceE\jdk\hello\Hello.ice compile: [mkdir] Created dir: C:\IceEJ-1.1.0\demo\IceE\midp\hello\classes [javac] Compiling 8 source files to C:\IceEJ-1.1.0\demo\IceE\midp\hello\classes [javac] Compiling 4 source files to C:\IceEJ-1.1.0\demo\IceE\midp\hello\classes [javac] C:\IceEJ-1.1.0\demo\IceE\midp\hello\Demo\_HelloDel.java:16: generics are not supported in -source 1.3 [javac] (use -source 5 or higher to enable generics) [javac] void sayHello(java.util.Map<String, String> __ctx) [javac] ^ [javac] C:\IceEJ-1.1.0\demo\IceE\midp\hello\Demo\_HelloDelD.java:17: generic s are not supported in -source 1.3 [javac] (use -source 5 or higher to enable generics) [javac] sayHello(java.util.Map<String, String> __ctx) [javac] ^ [javac] C:\IceEJ-1.1.0\demo\IceE\midp\hello\Demo\_HelloDelM.java:17: generic s are not supported in -source 1.3 [javac] (use -source 5 or higher to enable generics) [javac] sayHello(java.util.Map<String, String> __ctx) [javac] ^ [javac] 3 errors BUILD FAILED C:\IceEJ-1.1.0\demo\IceE\midp\hello\build.xml:35: Compile failed; see the compiler error output for details.
0
Comments
Java generics are only supported with the JDK >= 1.5.
Cheers,
Benoit.
The source attribute in the javac targets are to catch CLDC compatibility issues at compile time. You can alter the ant build file but the code won't likely pass the preverification step or run in an JME environment.
Cheers,
Brent
Where did you get this slice2javae translator? The slice2javae translator isn't included with Ice-3.2.0.
You should use the slice2javae translator from the Ice-E download page
Cheers
Benoit.
What i want to learn is how to include Ice communication protocol in a midp program. It shall run on a Nokia E70. I've made a midp program that communicates through socket, and now i want to use Ice instead. Is there any tutorials on how to compile and run java midp & Ice? Any hint much appreciated.
As beagles wrote: "Please note that you are trying to build the MIDP demos while using generics. The MIDP demos are only supported on CLDC 1.1 + MIDP 2.0 platforms which do not support generics".. I guess the hello demo cant be compiled since I dont have enough knowledge on what to change.. Well, thanks guys anyway ..
Or did you by any chance compile slice2javae from the IceE-trans-1.1.0 source package? If yes, did you build it with the static or DLL configuration?
If you built it with the DLL configuration, I suspect you're not using the Slice DLL built with the translator sources but instead use the one from Ice-3.2.0. You should build the translator with the static configuration to make sure it doesn't conflict with DLLs from Ice-3.2.0. See the INSTALL.WINDOWS file from IceE-trans-1.1.0 for more information on how to build slice2javae with the static configuration.
Cheers,
Benoit.
I have not (intentionally..) compiled it the way you described it. However, its no big deal that i cant compile the demo "hello", what i want is to be able to compile any midp packages with an ant-build-file. So in a way, i am looking for a tutorial on building ice apps for mobile devices. Mobile devices will be a big thing, in my opinion ...
The MIDP "hello" demo should compile and you need to sort out why it doesn't compile before trying to compile anything else. For some reasons your slice2javae is generating code with Java5 generics where it shouldn't, that's wrong. So you first need to figure out what's wrong with your slice2javae translator.
What does the command "slice2javae -version" say? Can you move the slice2javae translator out of the C:\Ice-3.2.0\bin directory and remove C:\Ice-3.2.0\bin from your PATH to make sure you're not using any conflicting Ice 3.2.0 DLL?
Cheers,
Benoit.
The "slice2javae --version" says its version 1.1.0
It's the version from this zip-file: IceE-trans-1.1.0-bin-win.zip
I have removed the slice2javae out of directory C:\Ice-3.2.0\bin.
It's now in C:\IceEJ-1.1.0\bin.
I have removed C:\Ice-3.2.0\bin from the PATH, and added C:\IceEJ-1.1.0\bin to the PATH and restarted the pc.
I unzipped the file "IceEJ-1.1.0.zip" again and placed it in C:\ root, to have a clean version.
When i run the ant file, heres the output:
I dont understand why ant or the build-file is looking for the slicer in the C:\ice-3.2.0\bin folder. Thanks benoit for your sincere support.
Here is info on which java sdk i run:
It's most likely looking into the C:\Ice-3.2.0 folder because you have the ICE_HOME environment variable set. Can you unset this environment variable and try again? The slice2javae executable will need to be in your PATH.
Cheers,
Benoit.
Now when i use ant to build the solution, it misses the path to J2ME edition:
There was a total of 37 faults, all about "missing package javax.microedition..."
I've compiled standard midlets before (with eclipse and nokia toolkit), i know i have microedition on the pc. Is it a path variable i need to set?
Cheers,
Brent
Hi!
When i looked into what is being compiled/ generated by the build.xml in the
\IceEJ-1.1.0\demo\IceE\midp\hello example, only the Hellowerver.jar is being built.
Here is a line in build.xml:
<target name="client-jar" depends="compile" if="midp">
1. When is "midp" true/supported?
I have tried removing the if-cases, having the *.jad + *.jar being built, but that did not produce a functioning midp application.
I first did a "ant clean" command to make the *.jad and *.jar go away. With "ant all" / "ant" it does only compile/ produce the Helloserver.jar
thanks for help
'midp' is defined either by editing the IceEJ-1.1.0/config/build.properties and uncommenting the "midp = on" line or defining midp on the command line. e.g.:
ant -Dmidp=on
Cheers,
Brent
I set the midp = on in the config/build.properties
also made both *.jad and *.jar be created in a tmp folder.
(edited the build.xml)
now when comiling, the *.jad and *.jar is created.
This is errormessage though:
jarlog.txt:
Where can I go from here? I have tried setting hasProguardAndMIDP = on in the build.properties which gives me the following message:
I have outcommented the hasProguardAndMIDP variable in the build.properties for now.
If you need to modify the demo build system for some reason, I recommend that you consult the ant documentation and use the original build.xml files while making changes. With the exception of the slice2javae task, the IceE for Java build system is pretty generic. If you don't really require a customized build, I recommend starting over by unpacking a fresh distribution (move or delete the previous one first) and proceeding with the knowledge you've gained so far.
Cheers,
Brent
I have the following software installed:
jdk-6-windows-i586.exe (java version 1.6.0_01),
j2me_wireless_toolkit-2_2-windows.exe (generates a C:\WTK22 folder),
Ice-3.2.0,
IceEJ-1.1.0 with bin folder added from IceE-trans-1.1.0-bin-win.zip
I have reinstalled IceEJ-1.1.0, only changed the config\build.properties to:
debug = on
WTK = C:/WTK22
In the folder C:\IceEJ-1.1.0\demo\IceE\midp\hello, I run these commands in a commandwindow:
ant clean
ant
Heres the output:
Why the hello\HelloServer.jar does not exist is because the rebuilt HelloServer.jar is placed in the tmp folder. So I would very much appreciate if you can rebuild this application (with ant clean command first..) to see what you get. If you succeed I would very much like to know what Java version, j2me wireless toolkit you have used. Thanks .
I still think that the build.xml (for use with ant) is faulty. Can someone check that? If u first clean out the *.jar and *.jad (ant clean) and then rebuild it (ant), can u run these in the emulator?
Cause I cant. Thanks for your time and effort
Which version of ant are you using?
It's a little weird that the jar error you were getting before was coming from the preverify task. Have you tried performing the build steps manually using the same environment? That would help identify any environmental issues or possible bugs with the toolchain.
Cheers,
Brent
I am using this version of ant: apache-ant-1.7.0-bin.zip
In my version of build.xml the *.jad cant find the *.jar cause they are not in the same folder: What Java version, ant-version, J2ME Toolkit do you use?
We are currently using ant 1.6.5, and Sun WTK 2.5 or Nokia S40 Platform SDK 2nd edition on Windows XP. I've also checked WTK 2.2 and WTK 2.3 beta and everything works fine.
Cheers,
Brent
jar -cfm "./HelloServer.jar" tmp25805\\META-INF\MANIFEST.MF -C tmp25805 .
When i change the parameters to the tmp catalog for the HelloClient.jar, the HelloClient.jar is created.
I then fill in the *.jar size in the *.jad.
Then they are ok to run. Strange that the preverify fails.
I will now try to build them without using this particular ant-file. Get back to this thread when I have tried that.