Setting up JDK on you computer: So You Can Begin Java Programming

This entry is part 1 of 47 in the series Java

-by Travis

If you watched the first Java programming video, and you aren’t getting the desired outcome in your command prompt, most likely you don’t have the Java Development Kit loaded.  This is a quick tutorial on how to get you caught up to par .  If you didn’t have that problem, you can skip this tutorial.  Basically, the javac means Java complier, which translates what we type/read in java to something that the computer can understand, I like to call that language computerish.  I’m also just typing some stuff so this ad to the left won’t ruin the layout of this tutorial, but that should be enough text, Let’s get started..

 

 

 

  • Go to google.com
  • Search “Java JDK”
  • Most likely click the first link (which should be a download page: here is the current site: http://www.oracle.com/technetwork/java/javase/downloads/index.html)
  • There should be four options to download (Java Platform JDK, JDK + JavaFX Bundle, JDK+ Java Beans, and JDK+ Java EE Bundle)  any of those options are fine to download, to follow along with this tutorial, just download the Java Platform JDK.
  • Install just like any other program, with all the default settings (Click next a bunch of times, read Term&Conditions, etc.)
  • Click the Start Button (yes this is tutorial for Windows) and go to My Computer
  • Click on the main harddrive (for most it is C:)
  • Click on the Program Files folder> Open up the folder called Java
  • Click on the version of Java you downloaded (something like jdk1.6.0_12)
  • Open the bin folder
  • Inside the bin Folder look for the File called javac, and right-click on it and go to Properties
  • A new window should pop up giving the properties of the javac, there should be an attribute called Location.  Find the and copy the path (example: “C:\Program Files\Java\jdk1.6.0_ 12\bin”
  • Now we have the Path Location, so Click the start button again and right-click on the “Computer” and open up the “Properties”.
  • In the left side bar look for “Advanced system settings” and open that up (Click Continue)
  • Towards the bottom of the popup, Click “Environment Variables…”
  • Set up a new  User variable by clicking the top most “New..” button (under the “User variables for xxxxx”)
  • for the Variable name, type: Path
  • and for the Variable value, paste your Location of the javac, for example:     C:\Program Files\Java\jdk1.6.0_ 12\bin
  • Click OK on all three popups and close your System settings panel as well.
  • open up the command prompt again (Click start and type “cmd” in the search, press enter)
  • Type “javac” in the command prompt and your problems should be solved

Hope that helps, and look forward to developing some applications/games with you guys.

 

Peace,

-Trav

Next Lesson

Author: trav

I'm just an average guy that love programming.

Share This Post On

48 Comments

  1. Hello I didn´t really get why this should be done? Can anyone replay :D thx

    Post a Reply
    • Hey John,
      Please go through the each step once again. Its illustrated in a very easy way. ( Its for Windows users)

      Further still if you don’t find any stuff post your comment. Anyone’d help you out I’m pretty sure.

      Peace.

      Post a Reply
  2. I had to reboot after create de variable in order to work.

    Post a Reply
  3. Thank you very much! It’s working perfectly now! :D A tip; when the ‘javac’ command doesn’t work in the end, you can try to restart the CMD. It worked for me. :)

    Post a Reply
    • Thanks, Trav – worked like a charm, and I can honestly say this could have taken me days to find on my own.

      And Thijs – thanks for the tip. Definitely worked like that for me. Interestingly, “java” worked right away, but “javac” didn’t work until I restarted the cmd prompt.

      Cheers!

      Post a Reply
      • i typed “javac” in the cmd and it said not recognized, even after restarting computer. typing “java” got me some info. what should i do?

        Post a Reply
  4. I was only able to find Javacpl and Javaw. Are either of these close to Javac?

    Thanks

    Post a Reply
    • I had the same problem. Then I noticed I was finding the file javac in a wrong folder. I was in the “jre7″ folder where are the files Javacpl and Javaw, you mentioned, but you have to go to the “jdk1.7.0″ folder, where you definitely find file “javac”.

      Post a Reply
    • Make sure you are in the right folder, Program Files or Program files(x86) you will have Java in both bud depending on which version of sdk you downloaded determines where javac is.

      Post a Reply
  5. Hi First of all thanks alot for the tuts

    i have just started with this, and i would like to know
    what will be the name of Environment Variable???
    will it be javac?

    if yes then i tried with same also restarted my PC but its not working…

    looking forward to quick reply..
    thanks in adv

    Post a Reply
  6. Can you tell us how to set this up in windows 7?

    Post a Reply
    • if you downloaded the x86 version over the x64, follow the directions but look in program files(x86) for javac

      Post a Reply
  7. Hey, I use MAC OSX Lion, I have last Xcode 4 version from App Store, and I want programing java with it but I don’t know what. I don’t have crate java project. Thanks and sorry for my english i’m spanish but I’m working to improve my english hehehe. bye.

    Post a Reply
  8. I have the same problem as Brian, after installing JDK, there is only a program files/java/jre/bin folder, and it does not contain a javac.exe. What is the next step in this case?

    Post a Reply
    • Hey there,
      Re check again! javac file will be found in the folder “C:\Program Files\Java\jdk1.7.0_02\bin”

      You need to search in the folder ‘bin’. ( type j once u reach this folder ). Right click that file and copy its location that’ll be useful little later.

      Further still if you don’t find any stuff post, your comment. Anyone’d help you out I’m pretty much sure.

      Peace.

      Post a Reply
  9. Re. my last comment, I have fixed the problem by unistalling a previously installed version of the JDK (1.6), restarting, then installing 1.7. Also, the javac.exe file is under the program files (x86) folder if you’re running a 64 bit version of Windows.

    Post a Reply
  10. javac is also present there. look carefully. there are few files with similarity in names. u might be cofused

    Post a Reply
  11. Hello, i do everything and when i type on the command “javac” open a black window (like the command pront) and then the window desappear!! What is wrong??? Thanks!
    From Costa Rica!! ;)

    Post a Reply
  12. on the download page there is no download for 32bit, only 64, what do i do?

    Post a Reply
    • Hey there,
      At the eclipse website you must get the download option for 32-bit computer. Have a deeper look again.

      Peace.

      Post a Reply
  13. thankyou very nice work man

    Post a Reply
    • I rlaley needed to find this info, thank God!

      Post a Reply
  14. I followed all of these instructions but for some reason in eclipse after I did the import shown in your java tutorial I still don’t have some of the jar file like the classes jar. Any help is greatly appreciated.
    Thanks

    Post a Reply
  15. hi travis
    thank you
    this collection is graat!

    Post a Reply
  16. Thanx a lot for this tutorial, and also for videos in youtube.

    Post a Reply
  17. thanks for the tutorial ….

    Post a Reply
  18. Guys if the cmd can’t find the command javac then go back into “environment variables” and make sure that you put the \bin at the end. When you copy and paste the location it does not have the \bin to it.

    Post a Reply
  19. oh thank you very much mybringback.com,, you helped me a lot.. although i starting creating now our thesis program which is a mobile application you helped me in installing jdk and other resources that i will need to develop our mobile application.. nevertheless can i ask you something?? it is possible that i can use either mysql or sqlLite as for database in java programming?? if yes how? please help me.. tnx..

    Post a Reply
  20. other simple way to perform…follow the steps.
    1. open c drive
    2. open program folder
    3. open java folder
    4. open jdk folder….(“jdk1.7.0_05″ something like that)
    5. right click on bin folder.
    6. select command prompt
    7. type – javac
    8. enter

    thanks….

    Post a Reply
  21. Hi there,

    I think its worth mentioning how to append more paths to the path variable. I already had a path set and didn’t want to mess with it. But after some reading I found that you can add more path values just by adding a semicolon. For example

    PATH = C:\Program Files\myPath;C:\Program Files\myPath2;C:\Program Files\myPath3

    This might be helpful for anyone who may already have a path variable set.

    Post a Reply
  22. It is an exellent stuff and the tutorial is so clear and easy to fallow.

    Post a Reply
  23. TNX DUDE, THIS ACTUALLY HELPED ME.

    Post a Reply
  24. Hey man I like your tutorial on youTube keep it up:)

    Post a Reply
  25. can I just know which jdk to download for windows xp?
    win x86 oR win x64??
    and ur tuts are awsmmm… :)

    Post a Reply
  26. i installed java jdk properly and it shows in the command prompt as well but you see i didn’t install the Eclipse , i took it from my friend and i copied it to D: drive . So when i double click the Eclipse file they say something like this
    failed to load the JNI shared library “C:\Program Files\Java\jdk1.7.0_10\bin..\jre\bin\server\jvm.dll”. Please help me on this

    Post a Reply
  27. Hi everyone!
    I have stuck in a problem. I have done all the steps correctly as they are illustrated. But when i started eclipse, a window popup and still showing

    “A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: C:\eclipse\bin\javaw.exe

    javaw.exe in your current PATH”

    please help me out of this ASAP.

    Post a Reply
  28. I uninstalled JDK and re-installed it. Now, i am facing the same problem as mirza’s. Resolve this problem ASAP please

    Post a Reply
  29. Works perfectly for me, i just followed the instructions in this tutorial. Thanks, and let’s stard coding ! P)

    Post a Reply
  30. works !!!! thank u….

    Post a Reply
  31. one of the best tutorial i ever have been through..! Amazing…

    THanks

    Post a Reply
  32. Please assist me,

    i have found the javac file in C:\Program Files (x86)\Java\jdk1.7.0_17\bin but when i navigate to the file and right click then select properties i get a box with tabs such as general, previous version, Details, Compatibillity etc at the top but cant seem to locate attribute called Location.
    thanks in advance

    Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>