Question by Ozzie: Java Help – My First Program?
Hello all,

I’m having a little trouble with Java. I’m taking a online course, so I’m having to just figure this out. I installed Java JDK 6 Update 6 with Java EE. From what I gather I’m suppose to write my programs in notebad (Textpad) and then compile them from command prompt. This is where I’m having trouble figuring out what to do, or if I’m even running Java itself properly (sort of lost). I wrote a simple program and named it

public class FirstProgram
// main method begins execution of Java application
public static void main( String args [] )
System.outprintln( “Welcome to Java Programming!”);


I can not figure out how to compile it or make it run to see if it works.

Any help would be great.

Running Vista by the way.

Best answer:

Answer by rollandb1
find out what directory javac is in and then copy your file to that directory then goto cmd and change to the directory where javac is and then you can compile it. also it has been along time since i have programmed java but i think that your System.Out.Println is wrong.
i would recommend doing a search on yahoo or goolge for environment variables you can add the path to the javac file and then you can run it from any directory till you do this though you have to run all you programs from the directory that contains javac

Know better? Leave your own answer in the comments!

2 thoughts on “Q&A: Java Help – My First Program?”

  1. First of all, you really didn’t need the JavaEE version, the standard JDK would have been sufficient.

    You need to open a command prompt. In vista, I think you do this by clicking the start menu and type cmd in the search box at the bottom of the start menu.

    In the command prompt do to the directory which has

    cd javamyprograms

    Once there type the following:

    If if compiles successfully, which it looks like it would, the javac command will produce a file called FirstProgram.class. To run it type:

    java FirstProgram

    Notice how the .class is omitted.
    Hope that helps

  2. well… step by step… as follow

    1. make correction from “System.outprintln” to “System.out.println ”

    2. at command problem, use command “dir” or “cd” change into the directory where u save u

    3. type “javac” in command, and enter.(if no message shows up mean compilation successful., otherwise, debug it)

    4. to run it, just type “java FirstProgram”

    that’s it. have a nice day.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.