`

ubuntu下jre配置

 
阅读更多

Installing JRE

First, decide on which architecture will be installed, and download the relevant file from the main Java website – if you’re running a 64 Bit Linux OS, download the 64 Bit JRE.

At the time of writing, 1.6.0 u16 can be downloaded from the following:32 bit JRE, and64 bit JRE. I wanted to install the x64 version, and so downloaded jre-6u16-linux-x64.bin to my Desktop. I also wanted to install it in its own directory in /opt, and so created a directory for it to sit in:

cd /opt
sudo mkdir java

I was also experimenting with the 32 and 64 bit versions, so made two extra directories within java:

cd java
sudo mkdir 32 64

I then moved the relevant file(s) to the respective directories, and made them executable:

32 bit:

sudo mv ~/Desktop/jre-6u16-linux-i586.bin /opt/java/32
sudo chmod 755 /opt/java/32/jre-6u16-linux-i586.bin

64 bit:

sudo mv ~/Desktop/jre-6u16-linux-x64.bin /opt/java/64
sudo chmod 755 /opt/java/64/jre-6u16-linux-x64.bin

The final part of the installation simply involves executing the binary file:

32 bit:

cd /opt/java/32
sudo ./jre-6u16-linux-i586.bin

64 bit:

cd /opt/java/64
sudo ./jre-6u16-linux-x64.bin

Regardless of architecture, this should create a sub directory called jre1.6.0_16.

Setting JRE 1.6.0 u16 as Default

The process simply involves telling the system that there is an alternative Java binary available, and to use this binary to execute an “java” commands:

32 bit:

sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/32/jre1.6.0_16/bin/java" 1
sudo update-alternatives --set java /opt/java/32/jre1.6.0_16/bin/java

64 bit:

sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.6.0_16/bin/java" 1
sudo update-alternatives --set java /opt/java/64/jre1.6.0_16/bin/java

Follwing the second command, there should be output to the terminal something along the lines of:

Using '/opt/java/32/jre1.6.0_16/bin/java' to provide 'java'.

or,

Using '/opt/java/64/jre1.6.0_16/bin/java' to provide 'java'.

depending on the architecture installed.

To double check everything is as it should be, in a Terminal run:

java -version

This should output something along the lines of:

java version "1.6.0_xx"
Java(TM) SE Runtime Environment (build 1.6.0_xx)
Java HotSpot(TM) 64-Bit Server VM (build xxxx, mixed mode)

That’s it. Now every time “java” is run, either explicitly from the Terminal, or via a Java executable (such as theEclipse IDE), the newly installed /opt/java/64/jre1.6.0_16/bin/java binary will be used as opposed to the binary installed by default. Simple, eh?

Installing the Browser Plugin

Note:For the 64 bit plugin, it is strongly recommended that you use the version of Firefox available for installation via your distribution’s repositories.

As with most Firefox plugins, they can be installed in ~/.mozilla/plugins – if it doesn’t exist, it can be created:

mkdir ~/.mozilla/plugins

It may also be necessary to uninstall any previous Java installations, such as IcedTea etc.:

sudo apt-get remove icedtea-gcjwebplugin

Note:if you’re upgrading from a previous JRE install, remove the old plugin first:

32 Bit:

rm ~/.mozilla/plugins/libjavaplugin_oji.so

64 Bit:

rm ~/.mozilla/plugins/libnpjp2.so

The Plugin can now beinstalledby either copying the file:

32 Bit:

cp /opt/java/32/jre1.6.0_16/plugin/i386/ns7/libjavaplugin_oji.so ~/.mozilla/plugins/

64 Bit:

cp /opt/java/64/jre1.6.0_16/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

or by creating a symbolic link to the file (this is the best option)

32 Bit:

ln -s /opt/java/32/jre1.6.0_16/plugin/i386/ns7/libjavaplugin_oji.so ~/.mozilla/plugins/

64 Bit:

ln -s /opt/java/64/jre1.6.0_16/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Once installed, restart Firefox. There are two methods to see if the Plugin is installed – navigate toabout:plugins

分享到:
评论

相关推荐

    Ubuntu 下jre的配置

    两种Ubuntu下jre 的配置的详细步骤,我弄了好久才弄好,自己整理的,实用

    ubuntu下修改权限以及配置JDK

    从sun官网下载了jdk-6u13-linux-i586.bin,安装(其实就是解压缩)完成后,出现了权限问题,我不能移动它,而且配置环境变量时不能修改profile文件。 于是摘要了下来

    Ubuntu_10.04_安装手记

    配置opera支持jre flash中文显示乱码为口口 在opera里添加自定义按钮 加载ISO镜像文件 加载NRG镜像文件 星际译王:stardict 卸载自带的firefox Gedit 打开Windows 下的txt文件乱码 .sh脚本文件运行 安装xnviewmp ...

    Kubuntu下安装配置Tomcat

    Kubuntu下安装配置Tomcat 第一步:下载并解压缩Tomcat部署文件 下载地址:略 第二步:配置Tomcat环境 第三步:测试安装 注意:运行错误解决 错误1:Neither the JAVA_HOME nor the JRE_HOME environment variable ...

    Ubuntu10.10搭建Android2.2基于ARM的交叉编译环境

    写了一份Ubuntu10.10上搭建Android2.2基于ARM的交叉编译环境的文档,供...注:由于疏忽,请把本文档第6页的“(3)配置环境变量”这一项中的"export JRE_HOME=JAVA_HOME/jre"修改为"export JRE_HOME=$JAVA_HOME/jre

    ejdk-8u201-linux-armv6-vfp-hflt.tar.gz 树莓派的JDK1.8

    用于树莓派的JDK,可能使用到centos和ubuntu上,在ubuntu18.04上测试已经通过,无需使用yum和apt-get安装使用解决配置环境后直接使用,需要的是将ejdk1.8.0_201\linux_armv6_vfp_hflt\jre\bin目录下所有的文件复制到...

    JDK1.6,Linux 64位

    jdk1.6.0_45,Linux 64位,Ubuntu 或者 CentOS 均可,亲测,解压即可用 (解压命令 tar -xf xxxxx.tar.gz), 配置环境变量 /etc/profile (非必要操作,因为 IDEA 可以直接选择 1.6 所在目录,无需添加环境变量) ...

    linux中工作用到的命令

    11. Ubuntu如何安装deb包 使用 dpkg解决依赖性问题 12. 安装activemq如果出现异常,则需要配置如下 13. 删除过期的文件 14. 安装 Apache Maven 14. 日志管理 15. 添加交换空间大小 16. linux远程拷贝文件 17. cmake...

    window_terminal.json

    windows terminal的配置文件,修改了主题、字体大小和半透明效果,terminal启动时默认打开ubuntu子系统标签,而不是powershell。

    docker-gerrit:使用 gerrit 代码审查系统构建 Docker 容器

    当前文件将构建一个基于 ubuntu:trusty 镜像的镜像。 图片包括: 主管 Gerrit 2.9 使用 H2 存储后端 图像中公开了以下端口: 8080/tcp (http) - Gerrit Web 界面 29418/tcp (ssh) - 受限的 gerrit ssh 守护进程 ...

    jboss 安装教程

    ./Java_ee_sdk-5_01-linux.bin,程序运行(程序默认装在opt/SDK/Jdk下) 如果报错:error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory。 解决方法...

    chef-jira:Atlassian Jira 的厨师食谱

    Atlassian JIRA Linux 安装程序将自动配置捆绑的 JRE。 如果您希望使用自己的 JDK/JRE,比如说java说明书,那么在撰写本文时,它必须是 Oracle 和 1.7 或 1.8 版。 有关最新列表,请参阅 使用java食谱进行必要的...

    vagrant-neo4j:在VirtualBox中运行Neo4j 2.0的流浪汉配置

    一个配置,用于在VirtualBox中运行Neo4j。 设置脚本是一个简单的bash shell脚本(没有Chef / Puppet / etc)。 我想要一个简单,轻巧和独立的脚本来构建我的环境,但是它可能并不适合每个人的需求。 安装次数 运行...

    InvertedIndexBuilder:内存限制下的倒排索引生成器

    表现环境物品价值中央处理器酷睿 i7 3612QM 操作系统Ubuntu 14.04.01 LTS 64 位JDK/JRE OpenJDK 运行时环境(IcedTea6 1.13.5) JRE 参数-Xmx512m 测试配置物品价值语料库来自维基百科的 10,228 页不同的令牌计数1,...

    docker-activemq:Apache ActiveMQ 的 Docker 镜像

    自述文件的 Dockerfile描述ActiveMQ 版本 - 5.9.0样板文件基于 Ubuntu 14.04 将自动更新和升级 Linux 软件包Dockerfile 构建应用程序细节自动安装以下内容: 卷曲默认 Java JRE 从 Apache 下载档案中提取 ActiveMQ ...

    vagrant-provision:提供给vagrant的脚本

    设置脚本用于配置机器的脚本。 最初用于提供无所事事的实例,但也可以与云映像或传统计算机一起使用。流浪汉Vagrant . configure ( 2 ) do | config | config . vm . define "ubuntu1404" , primary : true do | ...

    omni_local_manifests:为 Acer A200 和 A500 构建 Omnirom 的本地清单

    准备系统,执行本指南的步骤 1、2 和 5,以配置您的开发机器: 在 Ubuntu 上编译 JB 的教程 - xda-developers 警告:为了在从存储库构建 ROM 时取得成功,需要使用 Java-7 JRE (1.7) 如果不使用这个,则会出现不...

    TelebotMasterArms:Telebot Master Arms

    TelebotMasterArms Telebot Master Arms ... ### Eclipse IDE 常见问题 未设置JRE系统库 ...设置环境变量..1右键单击包含主类的Java->运行方式->运行配置->环境(选项卡)..2单击新建按钮..3名称: LD_LIBR

    TelebotSlaveMobility:Telebot从机移动组件

    TelebotSlaveMobility Telebot从机移动组件 ... ### Eclipse IDE 常见问题 未设置JRE系统库 ...设置环境变量..1右键单击包含主类的Java->运行方式->运行配置->环境(选项卡)..2单击新建按钮..3名称: LD_LIBRAR

    java多线程源码-ETL:该项目是用于多线程ETL的完整程序包-它包含代码,这些代码可以并行使用来自分布式ApacheKafka服务器的消息

    Ubuntu上安装和配置Kafka服务器 第1步-安装Java 将系统更新到存储库中的最新可用版本 $ sudo apt-get update Apache Kafka需要Java运行时环境,请使用apt-get进行安装 $ sudo apt-get install default-jre 第

Global site tag (gtag.js) - Google Analytics