JAVA is necessary to run certain applications in Linux and windows machine. JAVA comes with two packages (JDK & JRE). JDK stands for (Java Development Kit) which helps developers for developing, debugging, and monitoring Java applications.
JRE stands for (Java Runtime Environment) which deploys Java applications on servers.It includes tools for JVM monitoring and tools commonly required for server applications. Many of us needed only JRE, so make sure you have installed JRE not for JDE.
In this article i’m going to explain how to install OpenJDK in Linux such as Ubuntu based systems.
1) Search OpenJDK Packages
Use the below commands to search available java version on your distribution to install further.
2) Install JAVA (OpenJDK)
We have found the list of available JAVA version on Linux distribution in above step. Use the following commands to install required java (OpenJDK/JRE) version on your system through the package manager.
Install JRE - Java Runtime Environment
Install JDK - Java Development Kit
3) Verify JAVA (OpenJDK) Version
After successful installation of Java, use the following command to verify the installed version of JAVA on your systems.
4) Setup JAVA Environment Variables
We should Setup JAVA Environment Variables for java because all the java based application uses environment variables to work. Open your .bashrc file and add the below lines to end of the file. Make sure you need to mention your path instead of us, then Save and exit.
After saving .bashrc file, run the following command to make it work.
Now, check the environment value using below commands. Its clearly fetch the path of jdk and jre home.
5) Download Latest Apache JMeter Binaries
We will download the latest version of JMeter from http://jmeter.apache.org/download_jmeter.cgi
6) Extract JMeter Archive into /tmp
$ tar xvzf ~/Downloads/apache-jmeter*.tgz -C /tmp/
7) Installing JMeter
$ sudo mv /tmp/apache-jmeter* /opt/apache-jmeter
$ sudo ln -s /opt/apache-jmeter/bin/jmeter /usr/local/bin/jmeter
8) Launching JMeter
$ sudo jmeter
Finally, the JMeter software will appear on the screen.
不必問我是誰,我就像您一樣:僅是位平凡人,但卻想在人生旅途上留下生活的足跡! 哪怕是過程跌跌撞撞、經歷風風雨雨,只要有您的關注,就是我最大的欣慰與成就!!! 感謝您的蒞臨:) 下一個職涯十年信念:不到最後關頭,決不輕言放棄!!!
2017年3月13日 星期一
2014年4月27日 星期日
Ubuntu 14.04 --- Install Oracle Java 7 & 8 via PPA and set the environment variable
Due to some application require Oracle Java, we have to install it in the Ubuntu Desktop 14.04 LTS x64 besides OpenJDK.
How to install Oracle Java?
At first, we have to add an PPA by using the sudo add-apt-repository ppa:webupd8team/java for installing the latest Oracle Java as Java7 or Java8 in Ubuntu.

To update package list again by using sudo apt-get update command
If we want to install Oracle Java7, we can execute the sudo apt-get install oracle-java7-installer command. (# 1)
Of course, if we want to install Oracle Java8, we can execute the sudo apt-get install oracle-java8-installer command.
When the installation finish and success, we can realize which version will be used later by using the java -version command
As you know, if there is more than one version of Java,we have to choose one Java version to use in the system.
How to do it?
By using the sudo update-alternatives --config java command next to select one version as the following choice for us. (# 2)
So do that we also can understand the path of the java installation. If we have this information,we can set the “JAVA_HOME” and “JRE_HOME” environment variable later.
How to do it? At first, we need to know what is value on the “JAVA_HOME” variable by using the echo $JAVA_HOME command or “JRE_HOME” variable by using the echo $JRE_HOME command
As the above result, there is no any setting in this system now.
In the moment, we have already changed the default java to Java8 so that the java full path is /usr/lib/jvm/java-8-oracle/jre/bin/java
As to the environment variable setting, we have two method to do it.
For every user, we can set the environment variable by editing the /etc/profile file
For a particular user, we can set the environment variable by adding something in the end of the /home/<users>/.bashrc file
To reload this file and test it by using the echo $JAVA_HOME or echo $JRE_HOME command again
It will return the set path so that the environment variable has been set successfully.
Until now, we have already finished the Oracle JAVA installation and the environment variable setup.
Reference :
(# 1) Due to the WebUpd8 Oracle Java PPA doesn’t include any java binary files, it will help us to download and install Oracle Java automatically. In the installation process, we have to accept the license agreement as follows to go ahead.
(# 2) As to change the Java compiler(javac), it has a little different that just replace java with javac word as the
How to install Oracle Java?
At first, we have to add an PPA by using the sudo add-apt-repository ppa:webupd8team/java for installing the latest Oracle Java as Java7 or Java8 in Ubuntu.
To update package list again by using sudo apt-get update command
If we want to install Oracle Java7, we can execute the sudo apt-get install oracle-java7-installer command. (# 1)
When the installation finish and success, we can realize which version will be used later by using the java -version command
As you know, if there is more than one version of Java,we have to choose one Java version to use in the system.
How to do it?
By using the sudo update-alternatives --config java command next to select one version as the following choice for us. (# 2)
How to do it? At first, we need to know what is value on the “JAVA_HOME” variable by using the echo $JAVA_HOME command or “JRE_HOME” variable by using the echo $JRE_HOME command
In the moment, we have already changed the default java to Java8 so that the java full path is /usr/lib/jvm/java-8-oracle/jre/bin/java
As to the environment variable setting, we have two method to do it.
For every user, we can set the environment variable by editing the /etc/profile file
For a particular user, we can set the environment variable by adding something in the end of the /home/<users>/.bashrc file
To reload this file and test it by using the echo $JAVA_HOME or echo $JRE_HOME command again
It will return the set path so that the environment variable has been set successfully.
Reference :
(# 1) Due to the WebUpd8 Oracle Java PPA doesn’t include any java binary files, it will help us to download and install Oracle Java automatically. In the installation process, we have to accept the license agreement as follows to go ahead.
sudo update-alternatives --config javac command.
標籤:
技術---JDK,
技術---Ubuntu
2013年11月2日 星期六
JDK --- Install & Choose OpenJDK or Oracle JDK on CentOS x64
By default, the CentOS minimal installation doesn’t install any JDK as OpenJDK. If we need this component for executing Java program, how to install it?
Install OpenJDK and Use it by default
To confirm whether ever install the OpenJDK by using the rpm –qa | grep –E ‘^open[jre|jdk]|j[re|dk]’ or yum list installed | grep openjdk ,and realize whether exist a java symbolic link in the /etc/alternatives directory.
If ever install the OpenJDK, we can check what version locate on the RPM repository by using the yum list \*openjdk\* | grep openjdk command.
To install the Java Runtime Environment by using the yum install java-1.7.0-openjdk command
If we want to develop the Java program, we have to install the related package by using the yum install java-1.7.0-openjdk-devel command
To confirm the OpenJDK again by using the rpm –qa | grep –E ‘^open[jre|jdk]|j[re|dk]’ or yum list installed | grep openjdk ,we will found out the OpenJDK has already been installed and the java symbolic link exist in the /etc/alternatives directory.
To find the location of the JAVA_HOME environment variable by using the
To remove # sign from the /etc/java/java.conf file
To set JDK environment variable in the /etc/profile file next to apply the setting by using the source /etc/profile command
To verify whether the path is right by using the echo $PATH and the java use OpenJDK version by using the java - - version are right.
To find the path of the Java executable file by using the which java command or the location of java link by using the whereis java command.
Install Oracle JDK and Use it by default
If we want to use Oracle JDK, how to switch the JDK command from OpenJDK to Oracle JDK?
At first, we have to install Oracle JDK on the same platform (# 1) so that need to download this package from Oracle website.
Due to it fail to download the JDK package from Oracle by wget command
We still have to contact Oracle Java Archive for downloading it manually by clicking Java SE 6 link.
To select the right JDK version as Java SE Development Kit 6u45
To choose Accept License Agreement option
To select the right file as jdk-6u45-linux-x64-rpm.bin because the JDK will install on CentOS x64 by RPM method.
To sign in by the registered Oracle account and password next to download this file if the authentication pass.
To set the executable permission to this binary file by using the chmod +x ./jdk-6u45-linux-x64-rpm.bin command
To extract the java archive file but not directly install it by using the ./jdk-6u45-linux-x64-rpm.bin –x command
To upgrade/Install JDK by using the rpm –Uvh jdk-6u45-linux-amd64.rpm command So does that by default Java will be installed to the /usr/java/jdk1.6.0_45 directory and it creates two links /usr/java/latest & /usr/java/default
After the Oracle JDK package is installed,we need to configure each component as java by using the alternatives - - install /usr/bin/java java /usr/java/latest/jre/bin/java 20000 command and to tell the system that default java command has already switched to this by using the update-alternatives - - config java command.
To do the same step for javac by using the alternatives - - install /usr/bin/javac javac /usr/java/latest/bin/javac 20000 command and the update-alternatives - - config javac command
To do the same step for javaws by using the alternatives - - install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000 command and the update-alternatives - - config javaws command
To do the same step for javaws by using the alternatives - - install /usr/bin/jar jar /usr/java/latest/bin/jar 20000 command and the update-alternatives - - config javaws command
To list the symbolic link in the /etc/alternatives directory by using the ls –lA /etc/alternatives/ command and realize that set the default command for Oracle JDK now.
To change JAVA_HOME environment variable from /usr/lib/jvm/java-1.7.0-openjdk.x86_64 to /usr/java/latest in the /etc/profile file next to apply the setting by using the source /etc/profile command
To verify whether the path is right by using the echo $PATH and the java use Oracle JDK version by using the java - - version command.
Reference:
(# 1).On 64 bit Linux platform, we have to install one 32 bit JDK or 64 bit JDK but cannot co-exist if install it by RPM.
If we have to install the different version on the same platform, it will be workaround method that one is by RPM and the other is by BIN to install into the distinct directory.
Install OpenJDK and Use it by default
To confirm whether ever install the OpenJDK by using the rpm –qa | grep –E ‘^open[jre|jdk]|j[re|dk]’ or yum list installed | grep openjdk ,and realize whether exist a java symbolic link in the /etc/alternatives directory.
update-alternatives --display java
command. So does that we know the JAVA_HOME will be /usr/lib/jvm/jir-1.7.0-openjdk.x86_64Install Oracle JDK and Use it by default
If we want to use Oracle JDK, how to switch the JDK command from OpenJDK to Oracle JDK?
At first, we have to install Oracle JDK on the same platform (# 1) so that need to download this package from Oracle website.
Due to it fail to download the JDK package from Oracle by wget command
Reference:
(# 1).On 64 bit Linux platform, we have to install one 32 bit JDK or 64 bit JDK but cannot co-exist if install it by RPM.
If we have to install the different version on the same platform, it will be workaround method that one is by RPM and the other is by BIN to install into the distinct directory.
標籤:
技術---JDK,
技術---Oracle
訂閱:
文章 (Atom)
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.
©Copyright Davidwa Inc. All rights reserved.