Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: No error from netbeans, tons of errors with javac

  1. #1
    Junior Member
    Join Date
    Jul 2020
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default No error from netbeans, tons of errors with javac

    Hi guys,
    a dilemma. I use netbeans to prepare, debug, run my project. Everything seems ok and I get what I want even if its really slow.

    Today I tried to use javac -Xlint my.class another.class and got tons of errors.

    Question is why netbeans gives no errors while javac makes me cry?
    IMHO this means that once I get the final project with netbeans will put it in the trashcan if I want an executable (I dont like java -jar foo.jar)

    paps

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: No error from netbeans, tons of errors with javac

    got tons of errors.
    Can you post some of the error messages?

    What happens when you specify only one java source file with the javac command? Your example shows class files being passed as args to the javac command.

    Note: java source files have an extension of .java. The output from the compiler is written to a .class file.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jul 2020
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: No error from netbeans, tons of errors with javac

    I ran it again and noticed they are just warning.
    I expected netbeans to report them


    robin@mosby: javac -Xlint MamboUI.java displayResult.java > /HDB1/temp/java.log
    MamboUI.java:17: warning: [serial] serializable class MamboUI has no definition of serialVersionUID
    public class MamboUI extends JFrame {
           ^
    displayResult.java:61: warning: [rawtypes] found raw type: ArrayList
            ArrayList columnNames = new ArrayList();
            ^
      missing type arguments for generic class ArrayList<E>
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:61: warning: [rawtypes] found raw type: ArrayList
            ArrayList columnNames = new ArrayList();
                                        ^
      missing type arguments for generic class ArrayList<E>
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:62: warning: [rawtypes] found raw type: ArrayList
            ArrayList data = new ArrayList();
            ^
      missing type arguments for generic class ArrayList<E>
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:62: warning: [rawtypes] found raw type: ArrayList
            ArrayList data = new ArrayList();
                                 ^
      missing type arguments for generic class ArrayList<E>
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:89: warning: [unchecked] unchecked call to add(E) as a member of the raw type ArrayList
                        columnNames.add(ColumnName );
                                       ^
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:91: warning: [unchecked] unchecked call to add(E) as a member of the raw type ArrayList
                    else {columnNames.add(columnVal );}
                                         ^
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:97: warning: [rawtypes] found raw type: ArrayList
                    ArrayList row = new ArrayList(columns);
                    ^
      missing type arguments for generic class ArrayList<E>
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:97: warning: [rawtypes] found raw type: ArrayList
                    ArrayList row = new ArrayList(columns);
                                        ^
      missing type arguments for generic class ArrayList<E>
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:108: warning: [unchecked] unchecked call to add(E) as a member of the raw type ArrayList
                                       if (dummy.equals(pippo)) { pippo = "--"; row.add(pippo); } break;
    [.... all case inside a switch]
                                                                                       ^
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:137: warning: [unchecked] unchecked call to add(E) as a member of the raw type ArrayList
                            default  : row.add( rs.getObject(i) ); break;          
                                              ^
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:141: warning: [unchecked] unchecked call to add(E) as a member of the raw type ArrayList
                    data.add( row );
                            ^
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:150: warning: [rawtypes] found raw type: Vector
            Vector columnNamesVector = new Vector();
            ^
      missing type arguments for generic class Vector<E>
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:150: warning: [rawtypes] found raw type: Vector
            Vector columnNamesVector = new Vector();
                                           ^
      missing type arguments for generic class Vector<E>
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:151: warning: [rawtypes] found raw type: Vector
            Vector dataVector = new Vector();
            ^
      missing type arguments for generic class Vector<E>
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:151: warning: [rawtypes] found raw type: Vector
            Vector dataVector = new Vector();
                                    ^
      missing type arguments for generic class Vector<E>
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:155: warning: [rawtypes] found raw type: ArrayList
                ArrayList subArray = (ArrayList)data.get(i);
                ^
      missing type arguments for generic class ArrayList<E>
      where E is a type-variable:
        E extends Object declared in class ArrayList
    displayResult.java:156: warning: [rawtypes] found raw type: Vector
                Vector subVector = new Vector();
                ^
      missing type arguments for generic class Vector<E>
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:156: warning: [rawtypes] found raw type: Vector
                Vector subVector = new Vector();
                                       ^
      missing type arguments for generic class Vector<E>
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:159: warning: [unchecked] unchecked call to add(E) as a member of the raw type Vector
                    subVector.add(subArray.get(j));
                                 ^
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:161: warning: [unchecked] unchecked call to add(E) as a member of the raw type Vector
                dataVector.add(subVector);
                              ^
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:165: warning: [unchecked] unchecked call to add(E) as a member of the raw type Vector
                columnNamesVector.add(columnNames.get(i));
                                     ^
      where E is a type-variable:
        E extends Object declared in class Vector
    displayResult.java:264: warning: [serial] serializable class displayResult.CustomCellRenderer has no definition of serialVersionUID
    public class CustomCellRenderer extends JLabel implements TableCellRenderer {
           ^
    displayResult.java:33: warning: [serial] serializable class displayResult has no definition of serialVersionUID
    public class displayResult extends JFrame {
           ^
    38 warnings

    Note: ...and yes you are right. I was a typo. Its really hot here

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: No error from netbeans, tons of errors with javac

    I expected netbeans to report them
    Yes it should have reported them.

    The collection classes all use Generics. You should read up on Generics and start coding with it.
    https://docs.oracle.com/javase/tutor...ics/index.html
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Jul 2020
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: No error from netbeans, tons of errors with javac

    thank you

Similar Threads

  1. Javac Errors At Command Prompt
    By SecTech in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 19th, 2013, 06:15 AM
  2. i/o error when using Netbeans 7.3 and Java 7
    By btsutherland in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 23rd, 2013, 02:52 PM
  3. Running error Javac
    By ISHRAT JAHAN in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 17th, 2013, 03:12 AM
  4. [SOLVED] NetBeans and SQLite error
    By Boquito17 in forum JDBC & Databases
    Replies: 3
    Last Post: October 13th, 2012, 04:46 PM
  5. [SOLVED] Handling Errors / calling Error-Catching Methods
    By movsesinator in forum Object Oriented Programming
    Replies: 4
    Last Post: April 6th, 2010, 05:35 AM