Setup and Install Flow
Since I need to install Java at my company laptop for writing some easy program to help my works. (Also for learning and fun) However, I faced so many problems during setup and install the Java. Here is a record for the flow and problem faced for future reference. Hopefully it helps those visitors from all over the world who face similar problems.
As my laptop is using Windows 7, so all the procedures below are the setup process for Windows 7. I do the same with another laptop that using Windows 10. Probably the setup procedure are somehow the same.
1.) Download Java JDK and Java JRE
If you want to drink coffee, of course you need to buy or make a cup of coffee. If you need play with Java, you need not buy but could download for free from the Internet. At the moment, Java is owned by Oracle so we could download it officially from Oracle official page.
https://www.oracle.com/technetwork/java/javase/downloads/index.html
For JDK (Java Development Kit) , there are a few options: JavaSE, JavaEE, JavaME...etc. What's the difference amount these versions?
JavaSE is Standard Edition.
JavaEE is Enterprise Edition
JavaME is Micro Edition
Go https://stackoverflow.com/questions/2857376/difference-between-java-se-ee-me to see more.
As a normal user, I download the SE edition. The latest JavaSE version is 12. For easy handling, I just download the jdk-12_windows-x64_bin.exe. Just Download and double click the downloaded file, follow the steps and everything got done.
Beside of JDK, we also need the JRE (Java Runtime Environment). Why we need the runtime environment? If you ask this question, you probably have no idea how java works, so am I. You can go https://www.geeksforgeeks.org/differences-jdk-jre-jvm/ to learn more.
So where to download the JRE? You can go here:
https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
At the moment, there are two latest JRE version: 8u201 and 8u202. Some people says that the bigger number is the best options, however, it may not be the case. Actually it is about CPU(Critical Patch Update) and PSU(Patch Set Update). Go https://www.oracle.com/technetwork/java/javase/cpu-psu-explained-2331472.htmlto know more. Although the link is for an old version Java, it also clarify the difference for two versions.
For me, I downloaded 8u201 version.
2.) Install
Once download the two JDK and JRE installation files, just open the files and follow the guild to install JavaSE (JDK) and Java JRE.
Here are problems i faced during installation
Problem 1 - changed install location not workable
The preset install location for JDK is
C:\Program Files\Java\ jdk-12 (folder name depends on version) \
and JRE is
C:\Program Files\Java\jre1.8.0_201(folder name depends on version) \
However, I had changed the path to D: during my first installation. It makes me lots of trouble. I tried every solution e.g. set the correct variable environment and every possible but it still not work. Therefore, for beginner it's not recommended change the suggested installation path.
Problem 2 - Path setting
As a Windows user, we need to set the environment variable. Go https://www.java.com/en/download/help/path.xml to learn how to set environment variable.
Still can't run java after setting the environment, there are many reasons for not working.
Go https://stackoverflow.com/questions/4419983/a-jre-or-jdk-must-be-available-in-order-to-run-eclipse-no-jvm-was-found-after-s and https://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7to know more.
Also, in environment variable, always put JDK/bin in priority and next JRE/bin. I have no idea the reasons but it works for me once i reset JDK/bin on top.
No comments:
Post a Comment