dcsimg
www.webdeveloper.com
Results 1 to 9 of 9

Thread: Java Help Please!!!

  1. #1
    Join Date
    Dec 2002
    Posts
    11

    Question Java Help Please!!!

    HOW THE %#&$*_%&$&#!_$ DO YOU COMPILE JAVA!!! I know I need a compiler. I have the book "Java 2: The Complete Reference" and in there it says all you have to do is make an Example.java file(which they give the code for) and then go to the DOS command prompt and type in "javac Example.java" this is what it looked like in the book:

    C:\>javac Example.java

    and then it says to run the program, type this:

    C:\>java Example

    and then it says the output of the program will be:

    This is a simple Java program

    I cant even get past step 1!!! When I go to do the first step (javac Example.java) it says:

    'javac' is not recognized as an internal or external command, operable program or batch file.

    The book says that these steps are taken with the Java 2 SDK (Software Development Kit) and i downloaded it and tried it and messed around with it for a while but i just couldnt find anything that would compile java so i deleted it ..... please i need to know where to get a good compiler or how to compile java easily ..... thanks in advance

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    First of all you did not mention that what are the errors you ger? very crucial to determine a solution.
    Second it seems that if your machine is not properly set to run Java programs you may have some problems.
    By this I meat that
    1.You must have installed Java Runtime Environment on your machine.
    for this go to
    http://java.sun.com/j2se/1.4.1/download.html
    the link above and download the second item from the list.
    Remember you must download and install items from the column title "SDK".
    2.you'd need to set your environment variables,
    By that I mean that your computers OS will have to know that what will it do when you write a "javac test.java" and "java test"
    Environment variables do just that.
    3. Keeping that in mind go to the following link
    http://java.sun.com/docs/books/tutor...vVariables.htm

    there is a tone of information out there just do a google search with this string "set environment variables for java"

    It could be frustration some times.

    Let me know if you need further help
    k_ali@shaw.ca

  3. #3
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    37
    To clarify a couple of points:

    You need the Java SDK (software development kit). The Java Runtime Environment is only the software libraries needed to run compiled java (the SDK includes a JRE).

    Once you've got that, and got it installed, you need to make sure that javac.exe is on your execution path, which is controlled by an environment variable named PATH. javac.exe normally lives in [SDK install directory]\bin.

  4. #4
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    By the way blufive, did u event read my post...just a thought....cus if u did ,then u did not have to clarify...:-)

    cheers

    Khalid

  5. #5
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    37
    khalidali63:
    Yes, I did read your post, and it needed clarifying. So I did.

  6. #6
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    Originally posted by blufive
    khalidali63:
    Yes, I did read your post, and it needed clarifying. So I did.
    .
    :-)
    Lets see hunmm.
    From my first post

    the link above and download the second item from the list.
    Remember you must download and install items from the column title "SDK".

    Blufive responds .

    To clarify a couple of points:

    You need the Java SDK (software development kit).

    Geee thats different..take alook at the other point.

    2.you'd need to set your environment variables,
    By that I mean that your computers OS will have to know that what will it do when you write a "javac test.java" and "java test"
    Environment variables do just that.
    3. Keeping that in mind go to the following link
    http://java.sun.com/docs/books/tuto...nvVariables.htm

    there is a tone of information out there just do a google search with this string "set environment variables for java"

    blufive responds

    Once you've got that, and got it installed, you need to make sure that javac.exe is on your execution path, which is controlled by an environment variable named PATH. javac.exe normally lives in [SDK install directory]\bin.

    Just think about it it.( i seriously doubt that you can though)

    Man I am impressed....

    Khalid

  7. #7
    Join Date
    Nov 2002
    Posts
    631
    I have the Sun Developer Kit that uses the javac command. If you can't get passed step 1, it sounds like you don't have the compiler installed on your system. I think you can download it for free at http://java.sun.com . If you DO have the compiler, then maybe the computer can't find that file that you want javaced. Try typing the full path.

  8. #8
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    37
    Just think about it it.( i seriously doubt that you can though)
    Man I am impressed....
    Well, if you're going to be rude...

    Your first post had poor grammar and spelling, left out relevant information (the name of the environment variable to be altered) and included information ("you need a Java Runtime Environment") that could mislead the reader. So I attempted to clarify those points.

    Now, all this arguing is getting seriously off-topic, and not helping Dr1ft3r one jot. So why don't we wait and see if s/he has any more questions, and just try to answer them, rather than hurling insults at one another?

  9. #9
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    I agree....I appologies if u think I was trying to be rude..
    my appology...

    I was just clearing it a bit more..:-)

    Khalid

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles