I have just finished "Head First HTML with CSS & XHTML", my first venture into building a Website. I have now purchased "Head First Java 2nd Edition" and I have just basically opened the book. My query is.. After entering code into my text editor I beleive I have to compile the source code by running 'javac' but how and where do I run it? I'm using an Intel Mac Pro with the Leopard O/S. I expect yo will think this is easy, but I don't have a clue where to start and would very much appreciate your advice
Hey Denis, welcome to Javaranch. And to Macs. And to java, for that matter.
I have to compile the source code by running 'javac' but how and where do I run it?
You use the application called Terminal that comes with your mac. A quick search of this forum with "compile" gets you a bunch of discussions about starting out on a mac. Here's one to start chewing on:
Once you're at the terminal command line, everything will work pretty much the same as with any other Unix-based system. So tutorials written for any Unix should be helpful. Avoid tutorials written for Windows, which as we know has its own proprietary rules which don't apply to other OS's. [ December 31, 2007: Message edited by: Bear Bibeault ]
Hello Pauline, Bear and Marc, and a Happy New Year to you all. Thank you for your Guidance. As a result I have written, compiled and successfully run the "Class HelloWorld" (my first, hopefully not my last successful java code). I also realised in doing so that the code I was originally trying to compile from the book "Head First Java page 3 may not be complete. I did manage to compile it but I could not get it to run! It talks about starting Java Virtual Machine with Party.class but when I double click it nothing happens, and if I type it in the terminal i.e. java Party it displays the following:-
Exception in the thread "main" java.lang.NoSuchMethodError: main
I can only presume it might not be complete or I need this JVM and haven't got it on my Mac OSX?
Regards Denis. P.S Sorry for delay in replying got tied up with New Year celebrations.
Thank you Marc. the code on page 3 had compiled OK and because of that fact I had been unsure if indeed it was supposed to run. Regarding the JVM in the Mac OSX Leopard, forgive me if i'm asking a stupid question but how does one access the JVM? as I can't seem to locate it!
Thank you Bear Bibeault, I could not find anything in the Java folder indicating that JVM existed and I was under the misapprehension that I had to start something, like a programme hence I was looking for it! As I stated I am completely new to Java and was not aware that jvm started on it's own.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop