Re: Netbeans doesn't recognise compiler options ?

From: Michael Black (mblack_at_mblack.com)
Date: 02/20/05

  • Next message: Michael Black: "NetBeans 4.0 And Complie Options?"
    Date: Sat, 19 Feb 2005 18:17:12 -0600
    
    

    I have the same issue trying to find an API that is depreciated in either
    the Swing API or that AWT API. I have found where to add the switch in the
    build-inpl.xml but the ide does not dispaly the information in the output
    box.

    Anyone have any ideas or can provide assistance?

    Michael

    "Glenn McCall" <glennm@gtajb.com> wrote in message
    news:8fFMd.147061$K7.113383@news-server.bigpond.net.au...
    > Hi there I am using Netbeans 4.0 on windows XP. My problem is that the
    > compiler
    > doesn't 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 doesn't 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 don't 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 is not 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: Michael Black: "NetBeans 4.0 And Complie Options?"

    Relevant Pages

    • Re: Netbeans doesnt recognise compiler options ?
      ... I have the same issue trying to find an API that is depreciated in either ... I have found where to add the switch in the ... > Hi there I am using Netbeans 4.0 on windows XP. ... > notes (i.e. the compiler is recognising the switch): ...
      (comp.lang.java.programmer)
    • Re: Netbeans doesnt recognise compiler options ?
      ... I have the same issue trying to find an API that is depreciated in either ... I have found where to add the switch in the ... > Hi there I am using Netbeans 4.0 on windows XP. ... > notes (i.e. the compiler is recognising the switch): ...
      (comp.lang.java.help)
    • Netbeans doesnt recognise compiler options ?
      ... Hi there I am using Netbeans 4.0 on windows XP. ... achieve this I need to run the compiler with the switch "-source 1.4". ... I still get the Notes or Warnings depending ...
      (comp.lang.java.help)
    • Netbeans doesnt recognise compiler options ?
      ... Hi there I am using Netbeans 4.0 on windows XP. ... achieve this I need to run the compiler with the switch "-source 1.4". ... I still get the Notes or Warnings depending ...
      (comp.lang.java.softwaretools)
    • Netbeans doesnt recognise compiler options ?
      ... Hi there I am using Netbeans 4.0 on windows XP. ... achieve this I need to run the compiler with the switch "-source 1.4". ... I still get the Notes or Warnings depending ...
      (comp.lang.java.programmer)