Error when building J2ME application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheMan1
    New Member
    • Mar 2008
    • 19

    #1

    Error when building J2ME application

    Hi all, I get the following error when building a J2ME app:

    C:\Documents and Settings\xpd\j2 mewtk\2.5.2\app s\Test\src\MyTe st.java:86: for-each loops are not supported in -source 1.3
    (use -source 5 or higher to enable for-each loops)
    Something's obviously wrong with the Java version. I have Java 1.6.0_05 installed, though. I had an older version of Java installed previously, if that matters.

    How do I fix this error?
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    You're using an old compliance setting; if you're using Eclipse navigate to:
    Project>Propert ies>Java Compiler and set the level to 1.6. Otherwise, do as
    the error message suggested and use the "-source 6" or "-source 5" command
    line flag setting.

    kind regards,

    Jos

    Comment

    • TheMan1
      New Member
      • Mar 2008
      • 19

      #3
      Originally posted by JosAH
      You're using an old compliance setting; if you're using Eclipse navigate to:
      Project>Propert ies>Java Compiler and set the level to 1.6. Otherwise, do as
      the error message suggested and use the "-source 6" or "-source 5" command
      line flag setting.

      kind regards,

      Jos
      I'm using ktoolbar to compile the app. How do I do it in there?

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by TheMan1
        I'm using ktoolbar to compile the app. How do I do it in there?
        I don't know I never used it; read its user manual?

        kind regards,

        Jos

        Comment

        • TheMan1
          New Member
          • Mar 2008
          • 19

          #5
          The documentation doesn't contain anything about it. Anyone got an answer?

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by TheMan1
            The documentation doesn't contain anything about it. Anyone got an answer?
            What about the suggestion given by the error message iself? i.e. put in "-source 5"
            at your command line?

            kind regards,

            Jos

            Comment

            Working...