Results 1 to 7 of 7
  1. #1
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,037
    Rep Power
    8

    Default cannot find symbol variable NetworkInterrface

    Why I get an error here (cannot find symbol variable NetworkInterrface line 8)


    Java Code:
    import java.net.*;
    import java.util.*;
    
    
    
    public class InterfaceLister2 {
    	public static void main(String[] args) throws Exception {
                    NetworkInterface eth0 = NetworkInterrface.getByName("eth0"); 
                    Enumeration addresses = eth0.getInetAddresses(); 
                    while (addresses.hasMoreElements()) {
                        System.out.println(addresses.nextElement());
                    }
                    
    	}
    }

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default Re: cannot find symbol variable NetworkInterrface

    Why two "r" characters in Interface?

  3. #3
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,037
    Rep Power
    8

    Default Re: cannot find symbol variable NetworkInterrface

    Thanks I need a pair of glasses......

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,083
    Rep Power
    4

    Default Re: cannot find symbol variable NetworkInterrface

    Come on man. A typo. You must have either spent a whole 2 seconds looking at that error before you came here, or you need to drastically increase your screen resolution.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default Re: cannot find symbol variable NetworkInterrface

    Quote Originally Posted by gimbal2 View Post
    Come on man. A typo. You must have either spent a whole 2 seconds looking at that error before you came here, or you need to drastically increase your screen resolution.
    Awwww, gimbi, don't be so hard on him. ;-)
    Everyone has stumbled over this. Sure, most find it before posting on a forum, but it is still easy to do, and heh, maybe its just a bad day. ;-)

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,083
    Rep Power
    4

    Default Re: cannot find symbol variable NetworkInterrface

    Yeah sure, but there are limits!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    5

    Default Re: cannot find symbol variable NetworkInterrface

    OP: I recommend using a IDE or code editor that will highlight errors like this. It will save you a lot of time.

    I use Eclipse, but I hate it. Someday I'll take the time to evaluate NetBeans...
    Get in the habit of using standard Java naming conventions!

Similar Threads

  1. Another cannot find symbol variable thread
    By filipek in forum New To Java
    Replies: 5
    Last Post: 04-06-2014, 09:45 AM
  2. Cannot find symbol variable
    By xalebo in forum New To Java
    Replies: 4
    Last Post: 11-28-2011, 07:09 PM
  3. Replies: 4
    Last Post: 12-25-2010, 01:17 PM
  4. Cannot find symbol variable - Why? I can.. ^^
    By Mattedatten in forum New To Java
    Replies: 4
    Last Post: 03-08-2010, 07:07 PM
  5. Cannot find symbol variable pD! I cant fix it!!!
    By Addez in forum New To Java
    Replies: 2
    Last Post: 09-17-2009, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •