Get Mac Address in Java

  There is no basic pure Java API to access hardware information, it may be the future, who knows 

  Address the needs of the Mac part from the UUID, and the majority are from the License Management, it is really a silly thing, and hope that the software is selling services, not copy, save the trouble 

  Has found some, generally there are three types of solution - 

  1, JDK6, JDK7? 

  For details, see the following link http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4691932 

  2, Shell Command 

  Interception is ipconfig, such as ifconfig command output, and then Analysis 

  There are some open-source projects, such as http://sourceforge.net/projects/javanetcomm/ 

  There are many code snippet, such as http://forum.java.sun.com/thread.jspa?threadID=61556, http://forum.java.sun.com/thread.jspa?threadID=245711 

  A disadvantage of this approach is likely to require a higher authority system can be implemented such orders or visit LAN hardware 

  3, JNI 

  Also open-source projects include this feature, such as http://jug.safehaus.org/ 

  Deficiency is inconvenient deployment 

  However, not all networks are Ethernet, the License Management, Mac addresses only the more generic concept of "Host Id," a considerations. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Recommend Articles

Comments

Leave a Reply