Compiler Options in NetBeans 6.0?

Z

znelson

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!
 
M

Mark Space

znelson said:
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.
 
K

Kevin Bagust

Mark said:
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.
 
Z

znelson

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

Mark Space

znelson said:
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.
 
Z

znelson

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

I'm reinstalling and crossing fingers. Thanks Mark!
 
L

Lew

znelson said:
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).
 
Z

znelson

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
 
L

Lew

znelson said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top