unbuntu java环境安装与设置(chenxl)
来源:互联网 发布:运维和网络哪个好 编辑:程序博客网 时间:2024/05/01 03:39
安装jre
1)sudo apt-get install sun-java5-jre
安装jdk
2)sudo apt-get install sun-java5-jdk
我的源如下:
deb http://cn.archive.ubuntu.com/ubuntu/ dapper main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ dapper main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ dapper-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ dapper-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
# deb http://cn.archive.ubuntu.com/ubuntu/ dapper universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ dapper universe
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://cn.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu dapper-security main restricted
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted
# deb http://security.ubuntu.com/ubuntu dapper-security universe
# deb-src http://security.ubuntu.com/ubuntu dapper-security universe
# deb http://tonelli.sns.it/pub/mplayer/etch ./
# The Opera browser (packages)
#deb http://deb.opera.com/opera etch non-free
#deb ftp://ftp.nerim.net/debian-marillat/ stable main
# (00:24:00) AnThOnYhO: 这三个是w32codecs的源
#deb ftp://ftp.nerim.net/debian-marillat/ sarge main
#deb ftp://ftp.nerim.net/debian-marillat/ sid main
#deb ftp://ftp.nerim.net/debian-marillat/ etch main
#deb http://debian.cn99.com/ubuntu-cn dapper main
3)环境变量设置:
sudo update-alternatives --config java
选择 3 sun
4)测试:
输入 java -version
会出现java版本
编写个helloworld程序
public class HelloWorld{
public static void main(String[] args){
System.out.println("hello world!");
}
}
编译:javac HelloWorld.java
执行:java HelloWorld
输出 : hello world !
恭喜你 !!!!安装成功
1)sudo apt-get install sun-java5-jre
安装jdk
2)sudo apt-get install sun-java5-jdk
我的源如下:
deb http://cn.archive.ubuntu.com/ubuntu/ dapper main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ dapper main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ dapper-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ dapper-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
# deb http://cn.archive.ubuntu.com/ubuntu/ dapper universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ dapper universe
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://cn.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu dapper-security main restricted
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted
# deb http://security.ubuntu.com/ubuntu dapper-security universe
# deb-src http://security.ubuntu.com/ubuntu dapper-security universe
# deb http://tonelli.sns.it/pub/mplayer/etch ./
# The Opera browser (packages)
#deb http://deb.opera.com/opera etch non-free
#deb ftp://ftp.nerim.net/debian-marillat/ stable main
# (00:24:00) AnThOnYhO: 这三个是w32codecs的源
#deb ftp://ftp.nerim.net/debian-marillat/ sarge main
#deb ftp://ftp.nerim.net/debian-marillat/ sid main
#deb ftp://ftp.nerim.net/debian-marillat/ etch main
#deb http://debian.cn99.com/ubuntu-cn dapper main
3)环境变量设置:
sudo update-alternatives --config java
选择 3 sun
4)测试:
输入 java -version
会出现java版本
编写个helloworld程序
public class HelloWorld{
public static void main(String[] args){
System.out.println("hello world!");
}
}
编译:javac HelloWorld.java
执行:java HelloWorld
输出 : hello world !
恭喜你 !!!!安装成功
- unbuntu java环境安装与设置(chenxl)
- Unbuntu下安装Go环境
- Unbuntu环境下安装phpredis
- unbuntu下配置java环境
- Java开发环境安装与设置
- unbuntu 下android(MT6573) 编译环境设置
- 安装unbuntu
- JAVA编程环境的安装与环境变量的设置
- Eclipse的安装与Android和Java环境设置
- Unbuntu环境下安装Flask+Python+MySQL+Apache
- Unbuntu环境变量的设置
- ndk安装与eclipse环境的设置
- java安装与环境配置
- Unbuntu GTK安装
- unbuntu scim安装方法
- 安装 unbuntu 10.0.4
- ngnix 编译安装 unbuntu
- Unbuntu 安装 juniper
- 关于VFP中导出文本,各个老大能帮我吗?急急急!!!!!!!!!!
- Yahoo! Launches Python Developer Center
- Reading and Writing to Binary Files
- .NET Framework 3.0 版本命名与部署 Q&A
- Asp.Net常用代码
- unbuntu java环境安装与设置(chenxl)
- 如何利用Transact-SQL执行事务
- 技术的立足点
- 身体器官工作时间表,要注意作息!!
- 层的显示/隐藏代码
- 正确获取硬盘序列号源码.
- Filtering IP Packets on Router Interfaces with Extended Access Lists
- 商业模式(Business Model)
- 商业模式