Solved

Running a JAVA program

Posted on 2004-10-26
209 Views
Last Modified: 2010-03-31
Hi. I have Downloaded all the necesarry JAVA files I need. the SDK one I needed I downloaded. Now, (since I'm learning JAVA in school) I created a ".java" file but it doesn't execute using javac.exe or java.exe through the command prompt. I know this is probably been discussed on the homepage, But all I want to know is what I have to do (since I have the necesarry files) to compile and run a java programs. a step by step procedure would be helpful. Thanks.

Ryan
0
Question by:ryan423
    9 Comments
     
    LVL 37

    Accepted Solution

    by:
    0
     
    LVL 6

    Expert Comment

    by:expertmb
    to compile
    C:\myprogramdir\javac fileName.java
    to run
    java fileName
    0
     
    LVL 6

    Expert Comment

    by:expertmb
    just check
    @ the prompt do
    C:\javac
    0
     
    LVL 37

    Expert Comment

    by:zzynx
    All possible problems you could have with the classpath are described in the link I posted
    0
     

    Author Comment

    by:ryan423
    i'll check out the link thanks. would it be a permanent solution or would i have to do it everytime?
    0
     
    LVL 1

    Expert Comment

    by:Mindbender
    This is not an answer but advice.

    You should consider downloading NetBeans from www.netbeans.org, or if you don't like IDE's, at least something like TextPad from www.textpad.com that can call the compiler for you. Especially earlier on in your learning career, NetBeans will be extremely useful for managing packages and error tracing. You have to pay for textpad, but NetBeans is 100% free.

    0
     
    LVL 37

    Expert Comment

    by:zzynx
    >> would it be a permanent solution or would i have to do it everytime?
    You have both options available
    0
     

    Author Comment

    by:ryan423
    All I had to do was set the path variable to something like "C:\j2sdk1.4.2_06\bin". Now it's permanent. Thanks a many zzynx.
    0
     
    LVL 37

    Expert Comment

    by:zzynx
    Thanks
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    1. Package the applet into a JAR file. The applet must be in a JAR file before a certificate can be attached to it. Use the jar JDK utility. If the applet was previously referenced with the help of a codebase attribute in  tag, replace the codebase …
    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    934 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now