| Start | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Setting %PATH% and %JAVA_HOME% after installing on Windows Assumptions:
Setup stepsIn the navigation pane on the left right click on **This PC** (or **Computer** for older Windows versions). There is a shorter way without using the explorer in actual Windows versions: Just press Win+Pause In the newly opened Control Panel window, left click **Advanced System Settings** which should be in the top left corner. This will open the **System Properties** window. ](https://i.stack.imgur.com/E4c2M.png)
**CAUTION:** Windows relies on `Path` to find important programs. If any or all of it is removed, Windows may not be able to function properly. It must be modified to allow Windows to run the JDK. With this in mind ,click the "Edit..." button with the `Path` variable selected. Add `%JAVA_HOME%\bin;` to the beginning of the `Path` variable. It is better to append at the begining of the line because Oracle's software used to register their own version of Java in Check your work
Note: If you have to try again, close the prompt before checking your work. This will force windows to get the new version of |
||||||||||||||||||||
Installing a Java JDK on Linux Using the Package ManagerJDK and/or JRE releases for OpenJDK or Oracle can be installed using the package manager on most mainstream Linux distribution. (The choices that are available to you will depend on the distro.) As a general rule, the procedure is to open terminal window and run the commands shown below. (It is assumed that you have sufficient access to run commands as the "root" user ... which is what the Using the package manager is recommended because it (generally) makes it easier to keep your Java installation up to date.
The following instructions will install Oracle Java 8: Note: To automatically set up the Java 8 environment variables, you can install the following package: Creating a If you prefer to create the Note: This expects the input to be provided as a ".tar.gz" file.
On recent Fedora releases, In recent Fedora releases, there are no packages for installing Java 7 and earlier.
Using Gentoo Linux The Gentoo Java guide (opens new window) is maintained by the Gentoo Java team and keeps an updated wiki page including the correct portage packages and USE flags needed. Installing Oracle JDKs on Redhat, CentOS, Fedora Installing JDK from an Oracle JDK or JRE Installing from an Oracle Java RPM file. |
||||||||||||||||||||
| Installing a Java JDK on macOS Oracle Java 7 and Java 8 Java 7 and Java 8 for macOS are available from Oracle. This Oracle page answers a lot of questions about Java for Mac. Note that Java 7 prior to 7u25 have been disabled by Apple for security reasons. In general, Oracle Java (Version 7 and later) requires an Intel-based Mac running macOS 10.7.3 or later. Installation of Oracle Java Java 7 & 8 JDK and JRE installers for macOS can be downloaded from Oracle’s website:
After downloading the relevant package, double click on the package and go through the normal installation process. A JDK should get installed here: where corresponds to the installed version. Command-Line Switching When Java is installed, the installed version is automatically set as the default. To switch between different, use: The following functions can be added to the Apple Java 6 on macOS On older versions of macOS (10.11 El Capitan and earlier), Apple's release of Java 6 comes pre-installed. If installed, it can be be found at this location: Note that Java 6 passed its end-of-life long ago, so upgrading to a newer version is recommended. There is more information on reinstalling Apple Java 6 on the Oracle website. |
||||||||||||||||||||
| Installing a Java JDK or JRE on Windows Only Oracle JDKs and JREs are available for Windows platforms. The installation procedure is straight-forward:
An alternate way to install Java on Windows using the command prompt is to use Chocolately: Getting up and running with portable versions There are instances where you might want to install JDK/JRE on a system with limited privileges like a VM or you might want to install and use multiple versions or architectures (x64/x86) of JDK/JRE. The steps remain same till the point you download the installer (.EXE). The steps after that are as follows (The steps are applicable for JDK/JRE 7 and above, for older versions they are slightly different in the names of folders and files): This way, you can install any versions of JDK/JRE you need to be installed simultaneously. Original post : http://stackoverflow.com/a/6571736/1448252 (opens new window) |
||||||||||||||||||||
| Selecting an appropriate Java SE release There have been many releases of Java since the original Java 1.0 release in 1995. (Refer to Java version history (opens new window) for a summary.) However most releases have passed their official End Of Life dates. This means that the vendor (typically Oracle now) has ceased new development for the release, and no longer provides public / free patches for any bugs or security issues. (Private patch releases are typically available for people / organizations with a support contract; contact your vendor's sales office.) In general, the recommended Java SE release for use will be the latest update for the latest public version. Currently, this means the latest available Java 8 release. Java 9 is due for public release in 2017. (Java 7 has passed its End Of Life and the last public release was in April 2015. Java 7 and earlier releases are not recommended.) This recommendation applies for all new Java development, and anyone learning Java. It also applies to people who just want to run Java software provided by a third-party. Generally speaking, well-written Java code will work on a newer release of Java. (But check the software's release notes, and contact the author / supplier / vendor if you have doubts.) If you are working on an older Java codebase, you would be advised to ensure that your code runs on the latest release of Java. Deciding when to start using the features of newer Java releases is more difficult, as this will impact your ability to support customers who are unable or unwilling their Java installation. |
||||||||||||||||||||
| Java release and version naming Java release naming is a little confusing. There are actually two systems of naming and numbering, as shown in this table:
1 - It appears that Oracle intends to break from their previous practice of using a "semantic version number" scheme in the Java version strings. It remains to be seen if they will follow through with this. The "SE" in the marketing names refers to Standard Edition. This is the base release for running Java on most laptops, PCs and servers (apart from Android). There are two other official editions of Java: "Java ME" is the Micro Edition, and "Java EE" is the Enterprise Edition. The Android flavor of Java is also significantly different from Java SE. Java ME, Java EE and Android Java are outside of the scope of this Topic. The full version number for a Java release looks like this: This says JDK 1.8.0, Update 101, Build #13. Oracle refers to this in the release notes as: The update number is important -- Oracle regularly issue updates to a major release with security patches, bug fixes and (in some cases) new features. The build number is usually irrelevant. Note that Java 8 and Java 1.8 refer to the same thing; Java 8 is just the "marketing" name for Java 1.8. |
||||||||||||||||||||
| What do I need for Java Development A JDK installation and a text editor are the bare minimum for Java development. (It is nice to have a text editor that can do Java syntax highlighting, but you can do without.) However for serious development work it is recommended that you also use the following:
|
||||||||||||||||||||
Configuring and switching Java versions on Linux using alternatives Using AlternativesMany Linux distributions use the And so on. Now you can switch between different versions of a Java command as follows: For more information on using Arch based installsArch Linux based installs come with the command Listing installed environmentsSwitching current environmentEg: More information can be found on the Arch Linux Wiki (opens new window) |
||||||||||||||||||||
| Post-installation checking and configuration on Linux After installing a Java SDK, it is advisable to check that it is ready to use. You can do this by running these two commands, using your normal user account: These commands print out the version information for the JRE and JDK (respectively) that are on your shell's command search path. Look for the JDK / JRE version string.
Configuring PATH directly If there is no First, find where you installed Java; see Where was Java installed? below if you have doubts. Next, assuming that ... replacing Next, source the file that you just edited, so that the environment variables for your current shell are updated. Next, repeat the Finally, logout and login again so that the updated environment variables ptopagate to all of your shells. You should now be done. Checking Alternatives If If the output looks like this, : then the
Where was Java installed? Java can be installed in a variety of places, depending on the installation method.
If you are having difficultly finding the installation directory, We suggest that you use This gives you the pathnames for all files called |
||||||||||||||||||||
| Installing oracle java on Linux with latest tar file Follow the below steps to install Oracle JDK from the latest tar file: and Expected output: |
Read Article
https://develop.horje.com/learn/1434/reference