[TxMt] Re: Java Compile and run
Michael Sheaver
msheaver at earthlink.net
Mon Sep 10 00:57:39 UTC 2012
> Date: Mon, 10 Sep 2012 07:08:15 +1000
> From: David Howden <dhowden at gmail.com>
> To: TextMate users <textmate at lists.macromates.com>
> Subject: [TxMt] Re: Java Compile and run
> Message-ID:
> <CAP2kWKHah0sAKbNzh9GFwb6q-YfzJ=dqrSUDHgxrLoe9rvjqvg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Right, so I've had a little play with this.
>
> 1. Create a file called helloworld.java and save it on your desktop.
> 2. Put this in it:
> public class helloworld {
> public static void main(String[] args) {
> System.out.println("Hello World!");
> }
> }
> 3. Save again!
> 4. Cmd+R
>
> This runs perfectly for me in TM2 using the default Java bundle. Try
> it on your version (checking and double checking the filename and the
> class name match exactly).
>
> Cheers,
>
> David
Hey David,
I am pleasantly surprised, but your suggestion was what I needed! Apparently, the code I had used (below) 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.
Many thanks!
Michael
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); //Display the string.
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20120909/4c58e864/attachment.html>
More information about the textmate
mailing list