Chủ Nhật, 2 tháng 3, 2014

HOW-TO: set up Java environment on Ubuntu.

Hi all,
I am kind of big moving from Windows to Ubuntu including infrastructures, softwares, and even cultures. However, I still use both Windows and Linux. I cannot live isolated with surrounding Windows machine around me in labs even my laptop. Windows are simple and convenient for normal users, but Ubuntu is just great for developers.
I definitely love Eclipse. In this blog, we provide some guide to start Java life in Ubuntu. C/C++ life in Ubuntu are great and simple. I supposed that Java life is also simple across different OSs.
First, you need to install Java Development Kit (JDK) which includes Java Runtime Environments (JRE). Going to Oracle and download the newest jdk1.7 [1]. For example, I downloaded jdk1.7.0_51. Then I untar it.
tar xzf jdk-7u51-linux-x64.gz
 As a admin user, you can add or change these two lines in your /etc/profile to point to the installation and it will affect system-wide. OR as a normal user, you can export an environment variable in ~ /.profile. Where JAVA_HOME is the place you just untar your jdk, for instance, /home/tranlaman/Downloads/jdk1.7.0_51.
export JAVA_HOME=/home/tranlaman/Downloads/jdk1.7.0_51
export PATH=$PATH:$JAVA_HOME/bin
 Then, you log out and in again to see effect of the environment variables. After that, you download and install Eclipse from [2].
Further, if you want to install C/C++ plugin in Eclipse to develop C/C++ programs, you can follow this instruction. Go to Help/Install New Softwares, then add the C/C++ Development Toolkit (CDT) link in the box as http://download.eclipse.org/tools/cdt/releases/kepler.
You can replace kepler as the version of Eclipse. Then press Enter.

[1] http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
[2] https://www.eclipse.org/downloads/


Không có nhận xét nào:

Đăng nhận xét