ubuntu10.04安装sun jdk6
来源:互联网 发布:货到付款订单系统源码 编辑:程序博客网 时间:2024/05/29 08:57
1. 下载JDK
地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html,下载jdk-6u33-linux-i586.bin
2. 安装
官网的安装手册如下
Installation InstructionsThis procedure installs the Java Development Kit (JDK) for 32-bit Linux, using a self-extracting binary file. The JDK download includes the Java SE Runtime Environment (JRE) – you do not have to download the JRE separately.For RPM-based Linux distributions, like Red Hat or SuSE, refer to the RPM installation instructions.The name of the downloaded file has the following format: jdk-6u<version>-linux-i586.bin <version> jdk-6u18-linux-i586.binTo install, download this file and use the following instructions.1. Download and check the download file size. You can download to any directory that you can write to. This bundle can be installed by anyone (not only root users), in any location that the user can write to. However, only the root user can displace the system version of the Java platform supplied by Linux.2. Make sure that execute permissions are set Run this command: % chmod a+x jdk-6u <version>-linux-i586.bin 3. Change directory to the location where you would like the files to be installed. The next step installs the JDK into the current directory.4. Run the self-extracting binary. Execute the downloaded file, prepended by the path to it. For example, if the file is in the current directory, prepend it with " ./" (necessary if " ." is not in the PATH environment variable): % ./jdk-6u <version>-linux-i586.bin The binary code license is displayed, and you are prompted to agree to its terms. The JDK files are installed in a directory called jdk1.6.0_<version> in the current directory. Follow this link to see its directory structure. The JDK documentation is a separate download.5. Delete the bin file if you want to save disk space.6. If you want to use Java within the browser, setup the plugin using the instructions in Manual Plugin Installation for Linux. Note about Root Access: Installing the software automatically creates a directory called jdk1.6.0_ <version> . Note that if you choose to install the JDK into a system-wide location such as /usr/local, you must first become root to gain the necessary permissions. If you do not have root access, simply install the Java SE Runtime Environment into your home directory, or a subdirectory that you have permission to write to. Note about Overwriting Files: If you install the software in a directory that contains a subdirectory named jdk1.6.0_ <version> , the new software overwrites files of the same name in that jdk1.6.0_ <version> directory. Please be careful to rename the old directory if it contains files you would like to keep. Note about System Preferences: By default, the installation script configures the system such that the backing store for system preferences is created inside the JDK's installation directory. If the JDK is installed on a network-mounted drive, it and the system preferences can be exported for sharing with Java runtime environments on other machines.执行命令
chmod a+x jdk-6u33-linux-i586.bin
修改bin文件权限,使其可执行。然后执行 ./j
dk-6u33-linux-i586.bin
将 会出现字幕,持续按回车键,直到屏幕出现需要输入yes/no,此时输入yes/y 回车,将会把JDK解压到当前文件夹,得到jdk1.6.0_33.
此时JDK安装完毕。下面进行配置。
3. 配置3.1 配置环境变量
执行:sudo gedit /etc/environment
在 environment中修改如下信息:
PATH="........:/home/gg/jdk1.6.0_33/bin"CLASSPATH=".:/home/gg/jdk1.6.0_33/lib"JAVA_HOME="/home/gg/jdk1.6.0_33"其中
/home/gg/
是你的jdk安装目录
3.2 设置java和javac
由于ubuntu中有默认jdk还需要执行如下工作
执行代码:
sudo update-alternatives --install /usr/bin/java java /home/gg/jdk1.6.0_33/bin/java 300sudo update-alternatives --install /usr/bin/javac javac /home/gg/jdk1.6.0_33/bin/javac 300通过 这一步将我们安装的JDK加入java选单
3.3 配置默认的jdk
执行代码:sudo update-alternatives --config java
根据提示设置系统默认的JDK。
4. 测试执行:java -version
此时显示的系统中的java就是刚刚安装的 java
- ubuntu10.04安装sun jdk6
- Ubuntu10.04安装jdk6
- Ubuntu10.04下安装JDK6
- Ubuntu10.04下安装JDK6
- ubuntu10.04下手动安装sun jdk
- ubuntu10.10 安装 sun jdk
- Ubuntu 10.10上安装SUN JDK6
- 【转】ubuntu 11.10 下安装sun jdk6
- Ubuntu10.04上安装Sun-java6(zt)
- ubuntu10.04 64位 sun-java6-sdk安装
- ubuntu10.04 sun java6 源
- ubuntu10.10 sun java/jre安装
- Ubuntu10.10中安装sun-java6-jdk
- ubuntu10.10 安装sun-java6-jdk
- 在Ubuntu10.10下安装JDK5和JDK6
- linux(Ubuntu10.10)下安装jdk6的问题
- Ubuntu12.04安装JDK6
- ubuntu12.04安装jdk6
- 常用设计模式之应用场景/好处在哪儿
- unity3d 强大插件 playmaker 1.33
- [译]OpenCV的基础光学字符识别(Basic OCR in OpenCV)
- mongodb内存管理
- VC下通过直方图变换对图像进行有效增强
- ubuntu10.04安装sun jdk6
- LayoutInflater的inflate函数用法
- Android4.0新特性:拍照和拍视频可以收到广播了
- 并查集
- 呼叫中心建设
- WordPress中文出现乱码的解决方法
- 扎克伯格竟然赢得乔布斯生前的敬佩!
- 网页弹出窗口在主网页的正中间,加入右侧广告
- 18.指挥官只有一个——单件模式