Compiler Options in NetBeans 6.0?

Discussion in 'Java' started by znelson, Dec 10, 2007.

  1. znelson

    znelson Guest

    Having trouble and looking for a heads-up. I have an enum causing
    problems in NB 6.0 and the error is:

    enums are not supported in -source 1.3 (use a -source 1.5 or higher)
    etc etc

    I've looked all over and can't find the compiler options. I also don't
    understand why it would try to use 1.3 since I've never had that
    installed (this is a fresh 6.0 install with JDK1.5). I checked
    netbeans.conf and it shows:

    netbeans_jdkhome="C:\Program Files\Java\jdk1.5.0_14"

    So.. no idea where 1.3 is coming from and I'm out of ideas.

    Thanks in advance!
    znelson, Dec 10, 2007
    #1
    1. Advertising

  2. znelson

    Mark Space Guest

    znelson wrote:
    > Having trouble and looking for a heads-up. I have an enum causing
    > problems in NB 6.0 and the error is:
    >
    > enums are not supported in -source 1.3 (use a -source 1.5 or higher)


    Dunno. My brand new download of NB 6 supports enums just fine (I just
    checked.)

    Check Tools->Java Platforms, make sure you are using a recent JDK by
    default.

    You can right click on your project in the Projects view, select
    Properties->Build->Compiling and put "-source 1.5" as an argument for
    that project, but I'm not sure what the global command for that would be.

    Check your actual environment too, make sure you don't have any stray
    environment variable floating around. I don't know if Java does this
    but the old unix command line tools would look at the environment for
    default options for the compiler and linker, javac might be doing the same.
    Mark Space, Dec 11, 2007
    #2
    1. Advertising

  3. znelson

    Kevin Bagust Guest

    Mark Space wrote:
    > znelson wrote:
    >> Having trouble and looking for a heads-up. I have an enum causing
    >> problems in NB 6.0 and the error is:
    >>
    >> enums are not supported in -source 1.3 (use a -source 1.5 or higher)

    >
    > Dunno. My brand new download of NB 6 supports enums just fine (I just
    > checked.)
    >
    > Check Tools->Java Platforms, make sure you are using a recent JDK by
    > default.
    >
    > You can right click on your project in the Projects view, select
    > Properties->Build->Compiling and put "-source 1.5" as an argument for
    > that project, but I'm not sure what the global command for that would be.


    In this Project Properties dialog, if you select Sources there is an
    combo box towards the bottom Source/Binary format which should allow you
    to set the source level.

    Kevin.
    Kevin Bagust, Dec 11, 2007
    #3
  4. znelson

    znelson Guest

    Thanks Mark/Kevin,

    I must have a whacked version of NB6.0 because I don't have an option
    to set compiler options under the Build->Compiling section. I also
    don't have a combobox under the Sources Filtering or Libraries &
    Resources. My project is J2ME but that shouldn't hide the compiler
    options.

    I took a look at build-impl.xml and it had javac.source set to 1.3
    (somehow). I changed it to 1.5 but the project still won't compile
    (same error).
    znelson, Dec 11, 2007
    #4
  5. znelson

    Mark Space Guest

    znelson wrote:

    > I must have a whacked version of NB6.0 because I don't have an option
    > to set compiler options under the Build->Compiling section. I also
    > don't have a combobox under the Sources Filtering or Libraries &
    > Resources. My project is J2ME but that shouldn't hide the compiler
    > options.



    Isn't J2ME restricted to Java 1.1? I thought it was...

    Make a new project that's just a regular application, then check the
    options settings. That they don't appear in this project might be
    related to it being J2ME.
    Mark Space, Dec 11, 2007
    #5
  6. znelson

    znelson Guest

    ouch, that would be painful. the thought crossed my mind though. no
    enums in j2me eeeeek!

    I'm reinstalling and crossing fingers. Thanks Mark!
    znelson, Dec 11, 2007
    #6
  7. znelson

    Lew Guest

    znelson wrote:
    > Having trouble and looking for a heads-up. I have an enum causing
    > problems in NB 6.0 and the error is:
    >
    > enums are not supported in -source 1.3 (use a -source 1.5 or higher)
    > etc etc
    >
    > I've looked all over and can't find the compiler options.


    Clearly not *all* over. :)

    > I also don't understand why it would try to use 1.3 since I've never had that
    > installed (this is a fresh 6.0 install with JDK1.5). I checked
    > netbeans.conf and it shows:
    >
    > netbeans_jdkhome="C:\Program Files\Java\jdk1.5.0_14"


    This tells NetBeans what JDK to use for itself, not necessarily for each project.

    > So.. no idea where 1.3 is coming from and I'm out of ideas.


    Take a look at the project properties dialog, particularly the headings
    "Sources" - "Source / _B_inary Format:"
    "Libraries" - "Java Platform" (you might need the _M_anage Platforms..."
    button, but probably not this time).

    --
    Lew
    Lew, Dec 11, 2007
    #7
  8. znelson

    znelson Guest

    Hi Lew,

    I don't think my menu options are configured the way a non-J2ME
    project would be. When I go to project properties I have:

    General
    Platform
    Abilities
    Application Descriptor
    Build
    Sources Filtering
    Compiling (looked here)
    Libraries & Resources (here too)
    Obfuscating (I feel like I am)
    Creating Jar
    Signing
    Generatoring Javadoc
    Running
    Deploying

    I've completely uninstalled/reinstalled everything-java. I'm running
    NetBeans 6.0, Wireless Toolkit 2.5.2, and Java 1.6
    znelson, Dec 11, 2007
    #8
  9. znelson

    Lew Guest

    znelson wrote:
    > Hi Lew,
    >
    > I don't think my menu options are configured the way a non-J2ME
    > project would be. When I go to project properties I have:
    >
    > General
    > Platform
    > Abilities
    > Application Descriptor
    > Build
    > Sources Filtering
    > Compiling (looked here)
    > Libraries & Resources (here too)
    > Obfuscating (I feel like I am)
    > Creating Jar
    > Signing
    > Generatoring Javadoc
    > Running
    > Deploying
    >
    > I've completely uninstalled/reinstalled everything-java. I'm running
    > NetBeans 6.0, Wireless Toolkit 2.5.2, and Java 1.6


    Ah. I hadn't spotted that you were using JME when I answered.

    --
    Lew
    Lew, Dec 11, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pimousse
    Replies:
    2
    Views:
    3,633
    Roedy Green
    Apr 21, 2004
  2. Ilias Lazaridis
    Replies:
    0
    Views:
    908
    Ilias Lazaridis
    Dec 12, 2004
  3. Glenn McCall
    Replies:
    1
    Views:
    6,086
    Michael Black
    Feb 20, 2005
  4. Thomas G. Marshall
    Replies:
    2
    Views:
    826
    Thomas G. Marshall
    Oct 16, 2006
  5. Utkado
    Replies:
    2
    Views:
    2,098
Loading...

Share This Page