This is the first tutorial, in our JAVA video tutorial series, where I am going to highlight the steps you need to follow in order to download, install, and configure JDK on your machine. This is kind of a pre-requisite step, in case you wish to code, and run Java based applications. We are certainly going to talk more about its usage and the reason why exactly should we have it, later in this tutorial series but for now just trust me on this and follow the below mentioned steps, you’ll be able to set-up JDK on you machine. • Click on following link to perform a Google search: • Most probably you’ll end up on following page: • You may see various options under JAVA Platform SE 7( Standard Edition) like JDK, Server JRE, and simply JRE. Click on the download link below JDK. Support for connectivity of portable media windows vs mac. • Read and accept the license agreement and download the JDK package as per your environment [Windows/Linux/Mac/Solaris]. • Open the installer file and choose the default steps for easy installation. • Now, we need to make sure that all the executable files under installation directory like java, javac, javah,javap, javaw, etc. Are in the environment class-path. • The advantage of adding files in an environment class-path is that we can access/read/execute these files just by their file-names from a terminal/console/command-prompt/IDE and we don’t have to specify the full path of those files in order to execute them, they will be globally available to all the processes running on the environment. If we don’t add an executable file in the class-path then we have to specify the full-path of that file in order to execute them from a terminal/console/cmd • Sorry guys but right now this post is making me feel bored as hell so I’ll only cover how to configure JDK in a Windows environment, will update this post later to include Linux/Mac steps. • Windows: How to add JAVA files in environment class-path: • Right click on ‘My Computer’ >> Properties >> Advanced system settings >> System Properties window will open-up • Go to Advanced tab >> Environment Variables >> System variables section>> Click on New button • Set Variable name: JAVA_HOME and provide Variable value: as your local path of the JDK installation directory. E.g: C: Program Files Java jdk1.7.0_15 •%JAVA_HOME% directory usually contains following sub-directories: bin, include, jre, lib, etc. It also contains a src.zip file which contains the source code of core jars related to Java like%JAVA_HOME% jre lib rt.jar, etc. •%JAVA_HOME% bin directory contains all the java executable files so it should be present in the class-path for easier access • Go back to System variables section >> Scroll-down and open the Path variable for editing • Copy the Path variable value in a Notepad for easier editing • Add following text at the beginning of the original value:%JAVA_HOME% bin; • For e.g. If the old value looked something like abc;def;ghi;xyz; then new value should look like%JAVA_HOME% bin;abc;def;ghi;xyz; • Overwrite the Path environment variable value with the new value. Click on ‘OK’ button, wheresoever applicable. • Open windows command prompt:: Open run prompt[Win-key + r], type cmd and hit enter • Type echo%JAVA_HOME% hit enter to confirm that JAVA_HOME variable is set • Type echo%PATH% hit enter to confirm that JAVA_HOME bin directory is in environment PATH variable • Type javac hit enter and examine the output. If it resembles like below image, then we are done. You can readily use the commands java or javac from the command prompt. If you’re like me, you have different tools that have specific Java version requirements For example, versions 7 and 8, both the 32-bit and 64-bit editions. However, to support multiple versions you must update your Windows PATH. This video will describe how to download and install java in mac machine. And this video will explain how to set the environment variable path in the mac machine. • You must have noticed above that we only wrote javac as a command, which is basically an executable file[*.exe] residing in JAVA_HOME bin directory and we don’t have to specify the full path any more in order to execute it. Thanks for reading. Basically I had written an article how to install Java SE 7 / JDK 7 on Mac OS X Lion. I just would like to rewrite on the newest version. Download Oracle JDK 8 from. You need to accept license agreement to be able to download the file. Make sure you select the Mac OS X x64 platform (jdk-8u25-macosx-x64.dmg). Double-click the downloaded file ‘jdk-8u25-macosx-x64.dmg’ and follow the on-screen installation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |