<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite">Date: Mon, 10 Sep 2012 07:08:15 +1000<br>From: David Howden <<a href="mailto:dhowden@gmail.com">dhowden@gmail.com</a>><br>To: TextMate users <<a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a>><br>Subject: [TxMt] Re: Java Compile and run<br>Message-ID:<br><span class="Apple-tab-span" style="white-space: pre; ">    </span><<a href="mailto:CAP2kWKHah0sAKbNzh9GFwb6q-YfzJ=dqrSUDHgxrLoe9rvjqvg@mail.gmail.com">CAP2kWKHah0sAKbNzh9GFwb6q-YfzJ=dqrSUDHgxrLoe9rvjqvg@mail.gmail.com</a>><br>Content-Type: text/plain; charset=ISO-8859-1<br><br>Right, so I've had a little play with this.<br><br>1. Create a file called helloworld.java and save it on your desktop.<br>2. Put this in it:<br>public class helloworld {<br>   public static void main(String[] args) {<br>       System.out.println("Hello World!");<br>   }<br>}<br>3. Save again!<br>4. Cmd+R<br><br>This runs perfectly for me in TM2 using the default Java bundle.  Try<br>it on your version (checking and double checking the filename and the<br>class name match exactly).<br><br>Cheers,<br><br>David</blockquote></div><div><br></div><div>Hey David,</div><div><br></div><div>I am pleasantly surprised, but your suggestion was what I needed! Apparently, the code I had used (<font color="#e63b7a">below</font>) didn't have the class defined as public. I don't understand why that would make a difference, but hey, it works, and that's what really matters. </div><div><br></div><div>Many thanks!</div><div>Michael</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><font face="American Typewriter" color="#e63b7a">class HelloWorldApp {</font></div></div><div><div><font face="American Typewriter" color="#e63b7a">    public static void main(String[] args) {</font></div></div><div><div><font face="American Typewriter" color="#e63b7a">        System.out.println("Hello World!"); //Display the string.</font></div></div><div><div><font face="American Typewriter" color="#e63b7a">    }</font></div></div><div><div><font face="American Typewriter" color="#e63b7a">}</font></div></div></blockquote><div><span></span><span></span><div><br></div></div></body></html>