This prints NULL:
String sss = System.getSecurityManager() == null ? "NULL" : System.getSecurityManager().getClass().getName();
System.out.println(sss);
And this throws exception:
ServerSocket serversocket = new ServerSocket(80);
This one:
Exception in thread "main" java.lang.Error: java.net.BindException: Permission denied
at httpserver.HTTPServer.main(HTTPServer.java:68)
Caused by: java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:106)
at httpserver.HTTPServer.main(HTTPServer.java:38)
This actually works on Windows, but fails on OsX Snow Leo. Also it works with any other port, yet port 80 is not in use, and I run everything as admin.
Thanks!