Page 1 of 2 1 2 LastLast
Results 1 to 15 of 25

Thread: generics not supported in -source 1.3 ?

  1. #1
    westcoast is offline Registered User
    Name: Erik Lovbom
    Organization: Umea University
    Project: pervasive computing
    Join Date
    Apr 2007
    Posts
    14

    generics not supported in -source 1.3 ?

    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?

    Code:
    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.

  2. #2
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    Java generics are only supported with the JDK >= 1.5.

    Cheers,
    Benoit.

  3. #3
    westcoast is offline Registered User
    Name: Erik Lovbom
    Organization: Umea University
    Project: pervasive computing
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by benoit View Post
    Hi,

    Java generics are only supported with the JDK >= 1.5.

    Cheers,
    Benoit.
    Ok, well i run Java SDK 1.6, guess it may have to do with this extract from the ant-buildfile:
    Code:
    <target name="compile" depends="generate">
            <mkdir dir="${class.dir}"/>
    	<javac srcdir="${generated.dir}" destdir ="${class.dir}" source="1.3" debug="${debug}"
    	    bootclasspathref="midp.bootclasspath" classpathref="midp.classpath"/>
            <javac srcdir="." destdir="${class.dir}" source="1.3" excludes="generated/**" debug="${debug}"
    	    bootclasspathref="midp.bootclasspath">
                <classpath>
    	       <path refid="midp.classpath"/>
    	       <pathelement path="classes"/>
    	    </classpath>
            </javac>
        </target>
    However, when i change to source=1.6 i receive 21 errors instead of 3 I guess i need a tutorial.pdf for IceEJ very much the same as the pdf for ice-3.2.0 ..... Any other suggestions on what i can change? Its the demo-project in iceEJ, it should compile no problem.

  4. #4
    beagles's Avatar
    beagles is offline Registered User
    Name: Brent Eagles
    Organization: Eagles Technologies Inc
    Project: Asterisk SCF
    Join Date
    Feb 2003
    Location
    Newfoundland
    Posts
    111
    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 (see the Sun website for details) So basically it's a "don't do that" kind of situation.

    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

  5. #5
    westcoast is offline Registered User
    Name: Erik Lovbom
    Organization: Umea University
    Project: pervasive computing
    Join Date
    Apr 2007
    Posts
    14
    well, here is the output when running the build.xml with version=1.6 :
    Code:
    C:\IceEJ-1.1.0\demo\IceE\midp\hello>ant
    Buildfile: build.xml
    config-init:
    init:
    generate:
    [slice2javae] skipping Hello.ice
    
    compile:
        [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: cannot find symbol
        [javac] symbol  : class Map
        [javac] location: package java.util
        [javac]     void sayHello(java.util.Map<String, String> __ctx)
        [javac]                            ^
        [javac] C:\IceEJ-1.1.0\demo\IceE\midp\hello\Demo\_HelloDelM.java:26: cannot find symbol
        [javac] symbol  : method is()
        [javac] location: class IceInternal.Outgoing
        [javac]                 IceInternal.BasicStream __is = __og.is();
        [javac]                                                    ^
        [javac] C:\IceEJ-1.1.0\demo\IceE\midp\hello\Demo\_HelloDelM.java:60: cannot find symbol
        [javac] symbol  : method is()
        [javac] location: class IceInternal.Outgoing
        [javac]                 IceInternal.BasicStream __is = __og.is();
        [javac]                                                    ^
        [javac] 3 errors
    Has anyone else experienced this? thnx for your replies

  6. #6
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    [slice2javae] C:\Ice-3.2.0\bin\slice2javae --output-dir C:\IceEJ-1.1.0\demo\Ice
    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.

  7. #7
    westcoast is offline Registered User
    Name: Erik Lovbom
    Organization: Umea University
    Project: pervasive computing
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by benoit View Post
    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.
    Thanks guys for your patience with a newbie. Well, i copied the slice2javae from IceEJ-1.1.0 to Ice-3.2.0 ....

    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 ..

  8. #8
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    The slice2javae binary isn't included in the IceEJ-1.1.0 (.zip or .tar.gz) package. Did you mean the IceE-trans-1.1.0-bin-win.zip package?

    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.

  9. #9
    westcoast is offline Registered User
    Name: Erik Lovbom
    Organization: Umea University
    Project: pervasive computing
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by benoit View Post
    The slice2javae binary isn't included in the IceEJ-1.1.0 (.zip or .tar.gz) package. Did you mean the IceE-trans-1.1.0-bin-win.zip package?
    Well, it must have been from the IceE-trans-1.1.0-bin-win.zip package.
    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 ...

  10. #10
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Sorry, I don't understand what you're trying to do... you say you don't want to compile the "hello" demo but want to compile an MIDP application. I'm afraid if you can't even compile the "hello" demo you won't go very far into compiling another MIDP application...

    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.

  11. #11
    westcoast is offline Registered User
    Name: Erik Lovbom
    Organization: Umea University
    Project: pervasive computing
    Join Date
    Apr 2007
    Posts
    14
    Quote Originally Posted by benoit View Post
    ...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:
    Code:
    Buildfile: build.xml
    config-init:
    init:
    generate:
    [slice2javae] C:\Ice-3.2.0\bin\slice2javae  --output-dir C:\IceEJ-1.1.0\demo\IceE\midp\hello\generated C:\IceEJ-1.1.0\demo\IceE\jdk\hello\Hello.ice
    
    BUILD FAILED
    C:\IceEJ-1.1.0\demo\IceE\midp\hello\build.xml:25: Execute failed: java.io.IOExce
    ption: Cannot run program "C:\Ice-3.2.0\bin\slice2javae": CreateProcess error=2,
     File is not found (Det gÕr inte att hitta filen)
    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:
    Code:
    C:\IceEJ-1.1.0\demo\IceE\midp\hello>java -version
    java version "1.6.0_01"
    Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
    Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
    Last edited by westcoast; 04-30-2007 at 11:34 AM.

  12. #12
    benoit's Avatar
    benoit is offline ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    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.

  13. #13
    westcoast is offline Registered User
    Name: Erik Lovbom
    Organization: Umea University
    Project: pervasive computing
    Join Date
    Apr 2007
    Posts
    14
    I've removed the ICE_HOME environment variable.

    Now when i use ant to build the solution, it misses the path to J2ME edition:

    Code:
    compile:
        [javac] Compiling 2 source files to C:\IceEJ-1.1.0\demo\IceE\midp\hello\clas
    ses
        [javac] C:\IceEJ-1.1.0\demo\IceE\midp\hello\ClientMIDlet.java:13: package ja
    vax.microedition.midlet does not exist
        [javac]     extends javax.microedition.midlet.MIDlet
        [javac]                                      ^
        [javac] C:\IceEJ-1.1.0\demo\IceE\midp\hello\ClientMIDlet.java:14: package ja
    vax.microedition.lcdui does not exist
        [javac]     implements javax.microedition.lcdui.CommandListener
        [javac]                                        ^
        [javac] C:\IceEJ-1.1.0\demo\IceE\midp\hello\ClientMIDlet.java:88: package javax.microedition.lcdui does not exist ....
    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?

  14. #14
    beagles's Avatar
    beagles is offline Registered User
    Name: Brent Eagles
    Organization: Eagles Technologies Inc
    Project: Asterisk SCF
    Join Date
    Feb 2003
    Location
    Newfoundland
    Posts
    111
    You need to configure the CLDCLIB and MIDPLIB properties found in IceEJ-1.1.0/config/build.properties. There are two properties because the Sun WTK has the CLDC and MIDP classes in separate jar files. However, the Nokia toolkit you are using may include all of the required classes in a single library.If that is the case, I think you can get away with setting either property to point to the proper file.

    Cheers,

    Brent
    Last edited by beagles; 04-30-2007 at 02:04 PM.

  15. #15
    westcoast is offline Registered User
    Name: Erik Lovbom
    Organization: Umea University
    Project: pervasive computing
    Join Date
    Apr 2007
    Posts
    14
    I have configured the CLDCLIB and MIDPLIB properties found in IceEJ-1.1.0/config/build.properties, and finally (...) it works when i compile it with ant and the build.xml file! Thanks for your support

Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting a list of all facets supported by a proxy
    By Alexey Romanov in forum Help Center
    Replies: 2
    Last Post: 06-10-2010, 12:27 PM
  2. VC8.0 is supported?
    By OrNot in forum Help Center
    Replies: 1
    Last Post: 03-08-2010, 02:35 AM
  3. IceSL 0.3.2: oneway outgoing calls not supported?
    By kwaclaw in forum Bug Reports
    Replies: 1
    Last Post: 10-23-2008, 12:59 PM
  4. Replies: 3
    Last Post: 05-09-2008, 12:01 PM
  5. C# generics
    By bambuk in forum Help Center
    Replies: 1
    Last Post: 06-21-2007, 11:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •