Results 1 to 5 of 5
  1. #1
    rulian is offline Member
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Default Real Newbie Question - I'm sure its dumb

    Okay I started out with Head First Java this week.
    I read a bit into it and tried the standard "Hello World" program
    I've installed the JDK v .11 and its working fine running from comand prompt

    so I tried this
    PHP Code:
    public class greetings {
    	public static void main()
    	{
    		System.out.print("hellO"); 
    	}
    }
    in a file called greetings.java
    I go into dos and type
    javac greetings.java
    if I dont get errors I get nothing, not even "hello"

  2. #2
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default need the second part...

    If you didn't get any errors, that's good. What you did with the javac command is just compile your code. This will have produced another file named "greetings.class". Now you have to run the class file with the following command:
    Java Code:
    java greetings
    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  3. #3
    rulian is offline Member
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Default

    Awesome that worked!
    Guess that serves me right for skipping ahead in the book.
    Coming out of PHP which tends to do everything for you certainly will be interesting. Thanks

  4. #4
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default Welcome

    You're welcome.
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Just that it compiled on first go around means you're ahead of most starters. Good luck.

Similar Threads

  1. OpenGl transformation question newbie
    By ankitmcgill in forum New To Java
    Replies: 1
    Last Post: 11-16-2008, 03:46 AM
  2. Replies: 0
    Last Post: 09-28-2008, 11:02 AM
  3. Newbie search array question
    By CirKuT in forum New To Java
    Replies: 19
    Last Post: 09-14-2008, 06:26 AM
  4. Newbie question; Vectors
    By Kern in forum New To Java
    Replies: 7
    Last Post: 08-03-2008, 06:59 AM
  5. Newbie question about Static methods
    By SCS17 in forum New To Java
    Replies: 9
    Last Post: 02-06-2008, 08:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •