易截截图软件、单文件、免安装、纯绿色、仅160KB

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的 C++内存分配 知识,全局,局部,静态变量


预备知识—程序的内存分配 
一个由C/C++编译的程序占用的内存分为以下几个部分 
1、栈区(stack)— 由编译器自动分配释放 ,存放函数的参数值,局部变量的值等。其操作方式类似于数据结构中的栈。 
2、堆区(heap) — 一般由程序员分配释放, 若程序员不释放,程序结束时可能由OS回收 ......

java日期技巧总结

计算某一月份的最大天数
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);/ ......

给JAVA新手的一封信

亲爱的 Java 新手们:
很高兴你们愿意来这里共同学习,
Java 这个语言,已经不再是语言了,他勾勒出一个开放式的开发环境,
基本上 java.sum.com 很粗略地把 Java 分为三个部分:
(1)  J2SE ( Java 2 Standard Edition )
(2)  J2EE ( Java 2 Enterprise Edition )
(3)  J2ME ( Java 2 Micro Edition ) ......

掌握JAVA的标准

http://www.java-cn.com/technology/tech/4759.html
    偶尔在网上发现的一片关于掌握JAVA的标准,感觉有点意思,虽然在一些观点上有些偏颇,但作为学习JAVA的引导尚可。至于原创是谁没有必要考证。
时常看到一些人说掌握了Java,但是让他们用Java做一个实际的项目可能又困难重重,在这里,笔者根据 ......

内存监视 Java 源代码

/*
 * @(#)MemoryMonitor.java 1.3 05/11/17
 *
 * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号