title: How to Create ArrayList<Player> Spigot 1.12.2 - Java 8?
body: <p>I am having trouble creating an <code>ArrayList&lt;Player&gt;</code> in <a href="https://getbukkit.org/get/Fpt2yFn7HRTrot5uE1b8NFWtpQlYITgK" rel="nofollow noreferrer">Spigot 1.12.2</a>. I am currently using the <code>Java 8 version 231</code> to compile the plugin because it depends on <code>Java 8</code>. When I try to make this code:</p>
  
  <pre><code>ArrayList&lt;Player&gt; players = new ArrayList&lt;Player&gt;();
  
  for (Player p : players) {
      getServer().broadcastMessage(p.getDisplayName + " Is Online!");
  }
  </code></pre>
  
  <p>There are errors telling me to compile the project for <code>JRE 1.5</code>. I did that, but it didn't work showing errors in CMD when starting the server. I've been trying this for a few months now and I'm not getting it.</p>
  
  <p>In <code>JAVA 7</code> along with <code>Spigot 1.5.2</code> I was able to make the above code work smoothly, with <code>JAVA 8</code> and the <code>Spigot</code> upgrade to version <code>1.12.2</code> changed a lot that I don't know.</p>
  
  <p>Can anyone help me get the list of online players and save it to a <code>List</code> so I can loop it?</p>