Netbeans does not recognise compiler options ?
2 Message(s) by 2 Author(s) originally posted in java misc
| From: Glenn McCall |
Date: Friday, February 04, 2005
|
Hi there I am using Netbeans 4.0 on windows XP. My problem is that the
compiler
does not seem to be receiving *some* of my options. Has anyone else come
across
this and how did you fix it?
I am trying to compile so that the .
class files will
run in the 1.4
JVM . To
achieve this I need to run the compiler with the
switch "-source 1.4". But
Netbeans does not appear to be passing this switch to JAVAc!?!?!?!?
Details follow.
If I compile from the
command prompt (with the following), I can run it on
the
1.4 JVM no problems.
JAVAc -source 1.4 TestB.JAVA
as a matter of interest if I omit the "-source 1.4" switch I get the
following
notes (i.e. the compiler is recognising the switch):
Note: TestB.JAVA uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
If I compile in the
IDE and do not specify any switches, I get the above 2
messages (notes).
If I set the -Xlint:unchecked switch (right
click "Source Packages" then
select
"Properties". Then select "Compiling Sources" in the dialog and enter the
switch
in "additional compiler options"). Then the I get the
lint output as
follows:
TestB.JAVA:21: warning: [unchecked] unchecked call to add(E) as a member
of the
raw
type JAVA.util.LinkedList
This means that the -Xlint:unchecked is being passed to the compiler. So far
so
good.
Now if I follow the
logical sequence and enter -source 1.4 in the
"additional
compiler options" in Netbeans, I still get the
Notes or Warnings depending
on
the presence or absence of the -Xlint:unchecked switch. The class should
compile
without warnings just as it did in when I ran the compiler from the DOS
prompt.
So all I can assume is that NetBeans isn't passing the switch to the
compiler.
On the other hand if I put the switch in quotes (single or double) I get the
message "JAVAc: invalid flag: -source 1.4"
For what it is worth, here is the class I am working with:
package com.test;
import JAVA.util.*;
public class TestB {
public TestB() {
LinkedList l = new LinkedList ();
String s = "why";
l.add (s);
s = "is this";
l.add (s);
Iterator I = l.
iterator ();
while (i.hasNext ()) {
String v = (String) i.next ();
System.out.println (v);
}
}
public static void main (String [] args) {
TestB b = new TestB ();
}
}
| From: Michael Black |
Date: Saturday, February 19, 2005
|
I've the same issue trying to find an
API (application
programming interface)that is depreciated in either
the Swing API (application programming interface)or that
AWT API. I've found where to add the switch in the
build-inpl.xml but the ide doesn't dispaly the information in the output
box.
Anyone have any ideas or can provide assistance?
Michael> Hi there I am using Netbeans 4.0 on windows XP. My problem is that the
compiler
does not seem to be receiving *some* of my options. Has anyone else come
across
this and how did you fix it?
I am trying to compile so that the .class files will run in the 1.4 JVM.
To
achieve this I need to run the compiler with the switch "-source 1.4". But
Netbeans does not appear to be passing this switch to JAVAc!?!?!?!?
Details follow.
If I compile from the command prompt (with the following), I can run it on
the
1.4 JVM no problems.
JAVAc -source 1.4 TestB.JAVA
as a matter of interest if I omit the "-source 1.4" switch I get the
following
notes (i.e. the compiler is recognising the switch):
Note: TestB.JAVA uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
If I compile in the IDE and do not specify any switches, I get the above 2
messages (notes).
If I set the -Xlint:unchecked switch (right click "Source Packages" then
select
"Properties". Then select "Compiling Sources" in the dialog and enter the
switch
in "additional compiler options"). Then the I get the lint output as
follows:
TestB.JAVA:21: warning: [unchecked] unchecked call to add(E) as a member
of the
raw type JAVA.util.LinkedList
This means that the -Xlint:unchecked is being passed to the compiler. So
far
so
good.
Now if I follow the logical sequence and enter -source 1.4 in the
"additional
compiler options" in Netbeans, I still get the Notes or Warnings depending
on
the presence or absence of the -Xlint:unchecked switch. The class should
compile
without warnings just as it did in when I ran the compiler from the DOS
prompt.
So all I can assume is that NetBeans isn't passing the switch to the
compiler.
On the other hand if I put the switch in quotes (single or double) I get
the
message "JAVAc: invalid flag: -source 1.4"
For what it is worth, here is the class I am working with:
package com.test;
import JAVA.util.*;
public class TestB {
public TestB() {
LinkedList l = new LinkedList ();
String s = "why";
l.add (s);
s = "is this";
l.add (s);
Iterator I = l.iterator ();
while (i.hasNext ()) {
String v = (String) i.next ();
System.out.println (v);
}
}
public static void main (String [] args) {
TestB b = new TestB ();
}
}
>
Next Message: ridiculous - JAVAx.swing.text.html.HTMLEditorKit.Parser needs X11 server to work
Blogs related to Netbeans does not recognise compiler options ?
Windows Vista RTM Software Compatibility List
Jimi Schopp's Copy to Filename to Clipboard shell extension --
does not install (64-bit) NOTE: As a replacement, press shift and right-click on an object to bring up the 'improved' context menu with the 'Copy to Path'
option on it
...
php and mysql host
About the "Case" Though case php and mysql ost pjp and mysql host insensitiveness makes the cgi program. cgi-mailer php anmd mysql host
does not support EL, it is possible anywhere you have classic php edition mysql book sitepoint
...
Managing the Java classpath (UNIX and Mac OS X)
This command
does not compile every file found in either of those hierarchies.
... to debug if you don't
recognize the symptoms or know just what to look for.
... Most integrated development environments such as Eclipse and
NetBeans ...
informatyk
Use of GRIDportal
does not require any knowledge of Unix nor GRID computing whatsoever.
... JBuilder, IntelliJ IDEA,
NetBeans, and JDeveloper IDEs.
... selections with an exact URL the normalisation function could
not recognise.
...