We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public static void main(String[] args) { String a = NetUtil.getLocalAddress().getHostName(); String b = NetUtil.getLocalAddress().getHostAddress(); String x = NetUtil.getHostName(); String y = NetUtil.getLocalHost(); System.out.println("a=" + a); System.out.println("b=" + b); System.out.println("x=" + x); System.out.println("y=" + y); }
上面这个例子. 我在 mac os 上面测试 结果如下:
a=xxx.local b=172.30.60.29 x=null //这个没问题么? y=172.30.60.29
The text was updated successfully, but these errors were encountered:
环境是什么呢?windows 可以看看环境变量COMPUTERNAME有没设置,echo %COMPUTERNAME%
Sorry, something went wrong.
No branches or pull requests
上面这个例子. 我在 mac os 上面测试
结果如下:
The text was updated successfully, but these errors were encountered: