Ubuntu Install Java JDK and JRE
Ubuntu Linux Install Sun Java Development Kit ( JDK ) and Java Runtime Environment ( JRE )
by Vivek Gite
Q.
How do I install Sun
Java Development Kit (JDK) and Java Runtime Environment (JRE) under
Ubuntu Linux? It appears that there are multiple JRE installed by
default under Ubuntu. How do I select and use Sun JRE only? Can you
explain steps required to set the environment to run java programs or
apps?
A.
Ubuntu Linux 7.10 has following packages from Sun:
=> sun-java6-bin
: Sun Java Runtime Environment (JRE) 6
=> sun-java6-demo
: Sun Java Development Kit (JDK) 6 demos
=> sun-java6-jdk
: Sun Java Development Kit (JDK) 6
=> sun-java6-jre
: Sun Java Runtime Environment (JRE) 6
Install Sun Java 6
Open a shell prompt (terminal) and type the following to install JDK and JRE:
$ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
Setup the default Java version
Ubuntu Linux comes with update-java-alternatives utility to updates
all alternatives belonging to one runtime or development kit for the
Java language. To select, Sun's JVM as provided in Ubuntu 7.10, enter:
$ sudo update-java-alternatives -s java-6-sun
You also need to edit a file called /etc/jvm. This file defines the
default system JVM search order. Each JVM should list their JAVA_HOME
compatible directory in this file. The default system JVM is the first
one available from top to bottom. Open /etc/jvm
$ sudo vi /etc/jvm
Make sure /usr/lib/jvm/java-6-sun is added to the top of JVM list
/usr/lib/jvm/java-6-sun
At the end your file should read as follows:
/usr/lib/jvm/java-6-sun
/usr/lib/jvm/java-gcj
/usr/lib/jvm/ia32-java-1.5.0-sun
/usr/lib/jvm/java-1.5.0-sun
/usr
Save and close the file.
Setup the environment variable
You also need to setup JAVA_HOME and PATH variable. Open your
$HOME/.bash_profile or /etc/profile (system wide) configuration. Open
your .bash_profile file:
$ vi
$HOME/.bashrc
Append following line:
#set java envir
相关文档:
关于Java内存分配,很多问题都模模糊糊,不能全面贯通理解。今查阅资料,欲求深入挖掘,彻底理清java内存分配脉络,只因水平有限,没达到预期效果,仅以此文对所研究到之处作以记录,为以后学习提供参考,避免重头再来。
一、Java内存分配
1、 Java有几种存储区域?
* 寄存器
-- 在CP ......
计算某一月份的最大天数
Calendar time=Calendar.getInstance();
time.clear();
time.set(Calendar.YEAR,year); //year 为 int
time.set(Calendar.MONTH,i-1);//注意,Calendar对象默认一月为0
int day=time.getActualMaximum(Calendar.DAY_OF_MONTH);/ ......
http://www.java-cn.com/technology/tech/4759.html
偶尔在网上发现的一片关于掌握JAVA的标准,感觉有点意思,虽然在一些观点上有些偏颇,但作为学习JAVA的引导尚可。至于原创是谁没有必要考证。
时常看到一些人说掌握了Java,但是让他们用Java做一个实际的项目可能又困难重重,在这里,笔者根据 ......
自从学习Java以来已经一年有余了,对Java还只是初阶段的了解,都怪在学校的时候贪玩没有有效的利用时间,现在在一个培训学校学习Java,现在就要做项目了还是什么都不懂,还好有Csdn。
在Csdn的日子里叫我找到了家的感觉,得到了很 ......