code: public static String getMacAddress() throws UnknownHostException, SocketException {
          byte[] mac = NetworkInterface.getByInetAddress(Inet4Address.getLocalHost()).getHardwareAddress();
          StringBuilder jointMac = new StringBuilder();
          for (byte aMac : mac) {
              String macPart = Integer.toHexString(aMac & 0xFF);
              jointMac.append(macPart.length() == 1 ? "0" + macPart : macPart).append("-");
          }
          String macFormat = jointMac.toString();
          return macFormat.substring(0, macFormat.length() - 1);
      }
docs: 获取Mac地址
  
  @return mac地址
  
  @throws UnknownHostException 异常
  @throws SocketException 异常