bukkit java get player count

Java
Bukkit.getOnlinePlayers().size();
Source

Also in Java: