Is there a way to make only java be allowed to use a certain port?
OS: Windows Web Server 2008 R2
No access to router (hosted box).
You could use a personal firewall to enforce a rule for this specific behavior. For example, Windows Firewall with Advanced Security snap-in supports rules on port and application level. See Microsoft's documentation on Windows Firewall with Advanced Security on Windows Server 2008 R2 or this page for a quick tutorial on rule setup.