`

5 Ways to Install Java on Linux

阅读更多

http://www.wikihow.com/Install-Java-on-Linux

 

Manual Non-RPM Method

This is the generic method that also works with GNU/Linux clones that do not support RPM. It does not require administrator rights and allows installing multiple Java versions on the same computer.

  1. 1
    1. Download the JDK.[1].

    Ads by Google

    Best pay per install

    Highest payout in the market Start Now!
    www.installerex.com/
    • Click on the "Download" link under Java Platform (JDK) 7u4.
    • Accept the license and continue.
  2. 2
    Select the right download. Under the "Product/File Description" you should pick your corresponding Linux option. For example, if you're running Linux x86 (32-bit), you need to choose the corresponding “*.tar.gz” version.

  3. 3
    Download the file as a .gz. Save it to your GNU/Linux machine.
  4. 4
    Switch to the directory where you saved the file. You do not need to be a root and only must have the write access to the folder where you wish to install Java. If your administrator is not supportive, you may need to place Java into your home folder or (even better) on some shared network location
  5. 5
    Uncompress the file. For example, you could do this in your home folder. Uncompressing will create a folder called “jdk1.7.0_04”. Java is now installed.
    • The installed Java jre is rather independent and can be easily moved into another place just by copying all its files.
    • You can install multiple different jre's this way: they coexist together and can be used if some software requires the older version to run.
  6. 6
    Launch Java. The Java executable you need to launch is located in a subfolder, called "bin." This way of installation will not configure a default Java command for you — you must do this manually or always include the full path in your startup script.

Manual RPM Method

This seems like a "more civilized" way to install Java because it allows the installer to check the dependencies on some system libraries that may be missing. However, it does not support versioning easily and may fail even in some systems that do support RPMs. (Though the current Java installations are rather self-dependent and the required minimal requirements are usually satisfied anyway.)

  1. 1
    Download the JDK.[2].
    • Click on the "Download" link under Java Platform (JDK) 7u4.
    • Accept the license and continue.
  2. 2
    Select the right download. Under the "Product/File Description" you should pick your corresponding Linux option. For example, if you're running Linux x86 (32-bit), you need to choose the corresponding “*.rpm” version, for example “jdk-7u4-linux-i586.rpm”.

  3. 3
    Download the .rpm file. Save it to your GNU/Linux machine.
  4. 4
    Log in as root and switch to the directory where you saved the file. Or, become root by running su and entering the super-user password.
  5. 5
    Install the rpm file by executing 'rpm -ivh filename.rpm', where filename is the name of your .rpm file. (Such as jdk-7u4-linux-i586.rpm).
    • You may receive a message telling that program “rpm” is not installed.
    • If that is the case the program “rpm” is not installed. You need to install it writing: sudo apt-get install rpm. Enter your password, and you're finished.
  6. 6
    Create symbolic links. If you want to be able to execute this version of Java interpretor or compiler from any directory on your GNU/Linux system, you will have to create a few symbolic links:
    • sudo ln -s -v jdk1.7.0_04/bin/java /usr/bin/java
    • sudo ln -s -v jdk1.7.0_04/bin/javac /usr/bin/javac
    • Note that by installing using this method there could be dependencies that fail. It is better to use the package installer that handles all dependencies for you, since you will not be able to use Java correctly until the dependencies are resolved.

Ubuntu Method Using a GUI Package Manager

  1. 1
    Open a package manager. You can use Synaptic or Adept Manager.
  2. 2
    Install Open JDK. Java JDK and JRE are not available for installation through GUI Package Manager. You'll need to install Open JDK instead.
    • Perform a search for openjdk-7-jdk.
    • Select openjdk-7-jdk for installation. Depending on the package manager, you may be asked if you wish to install the required dependencies or it will automatically select them without confirmation. For example, the openjdk-7-jre was already selected by Synaptic Package Manager. If you want to use Java as a plug-in in your browser, then also select to install icedtea-7-plugin.
  3. 3
    Apply the changes. Click the button to apply the changes. Depending on the package manager, a pop-up window may appear asking for you to confirm the changes.
  4. 4
    Wait for Java to install.


Ubuntu Method Using a Console

  1. 1
    Enter one of the following commands into your console program:
    • sudo apt-get install openjdk-7-jdk openjdk-7-jre (if you don't want the browser plug-in)
    • sudo apt-get install openjdk-7-jdk openjdk-7-jre icedtea-7-plugin (if you do need the plug-in)
    • apt-get automatically takes care of the dependencies and lists the changes for confirmation.
  2. 2
    Enter y to confirm the installation.

Ubuntu OpenJDK Method Using a Console

  1. 1
    Ubuntu no longer supports the Sun Java package in favor of OpenJDK.
  2. 2
    Enter one of the following into your console program:
    • If you do not want the browser plugin, sudo apt-get install openjdk-6-jre.
    • If you do want the browser plugin, sudo apt-get install openjdk-6-jre icedtea6-plugin
    • If you're working on a server without graphics, and want an environment just for running server applications (e.e. Tomcat or Glassfish), sudo apt-get install --no-install-recommends openjdk-6-jre-headless
    • If you need the full JDK (for writing Java programs): sudo apt-get install openjdk-6-jdk
    • apt-get automatically takes care of the dependencies and lists the changes for confirmation.
  3. 3
    Enter y to confirm the installation.
分享到:
评论

相关推荐

    SimpleMapServer releaserelease 0.713

    It should run on any platform supporting java 1.4.x or 1.5.x, It was tested on SunOs/Linux/Windows XP. 2) How to use the map server? - They are two ways of using it: a) the most common is to ...

    Docker-in-Action.pdf

    One day I sat down to install the software and start integrating a personal proj- ect. At this point I had several years of experience working with open source applica- tions, but few were as ...

    C PROGRAMMING TUTORIAL

    There are two ways to define constants in C. - **Using `#define`:** Preprocessor directive to create symbolic names for values. - **Syntax:** `#define NAME value` - **Example:** `#define PI 3.14` -...

    Alibaba_Java_Coding_Guidelines-2.2.3.0x.zip

    Alibaba_Java_Coding_Guidelines-2.2.3.0x

    【ABB机器人】-IRB460机器人维护信息V1.pdf

    【ABB机器人】-IRB460机器人维护信息V1.pdf

    新能源汽车VCU控制器全开源:从代码到硬件设计的全面解析

    内容概要:本文详细介绍了新能源汽车VCU(车辆控制单元)控制器的开源项目,涵盖从应用层代码到底层代码、原理图、PCB设计、通信协议及控制策略等多个方面。应用层代码展示了如何根据电池电量调整车辆行驶模式,底层代码涉及硬件驱动如GPIO控制和ADC采样配置。硬件设计部分包括详细的原理图和PCB布局,确保系统的稳定性和可靠性。通信协议采用CAN网络,确保数据可靠传输,控制策略则涵盖了能量回收、扭矩控制等关键技术。丰富的文档资料和测试用例为开发人员提供了宝贵的学习和开发资源。 适合人群:新能源汽车开发人员、硬件工程师、嵌入式软件工程师、学生及研究人员。 使用场景及目标:帮助开发人员深入了解新能源汽车VCU控制器的工作原理和技术细节,加速项目开发进程,降低开发难度。无论是初学者还是有经验的专业人士,都可以从中受益。 其他说明:该项目不仅提供了完整的源代码和硬件设计文件,还包括详细的测试用例和故障处理方案,使得VCU开发变得更加透明和可复现。

    详解DeepSeek的十个安全问题.pdf

    详解DeepSeek的十个安全问题.pdf

    《网络传播技术与实务》第10章-握在手中的网络——移动通信与无线网络技术.ppt

    《网络传播技术与实务》第10章-握在手中的网络——移动通信与无线网络技术.ppt

    《计算机专业英语》chapter9-Communication-by-Avatars.ppt

    《计算机专业英语》chapter9-Communication-by-Avatars.ppt

    Xrunner的使用手册

    性能测试工具Xrunner的使用手册

    基于自抗扰控制(ADRC)的永磁同步电机(PMSM)矢量控制调速系统仿真研究与实现

    内容概要:本文深入探讨了基于自抗扰控制(ADRC)的永磁同步电机(PMSM)矢量控制调速系统的仿真方法及其优势。首先介绍了模型搭建,包括DC直流电压源、三相逆变器、永磁同步电机、采样模块、Clark、Park、Ipark以及SVPWM等关键组件。接着详细解析了ADRC在电流环和转速环中的应用,展示了其通过扩张状态观测器(ESO)实现的高精度扰动观测与补偿机制。文中还提供了部分MATLAB代码示例,如SVPWM模块和ADRC控制器的具体实现。仿真结果显示,ADRC相比传统PI控制器,在突加负载时表现出更好的稳定性和更快的响应速度,且不存在积分饱和问题。此外,文章讨论了一些实际应用中的注意事项和技术挑战。 适合人群:从事电机控制领域的研究人员、工程师及高校相关专业师生。 使用场景及目标:适用于希望深入了解和掌握现代先进电机控制技术的研究人员和工程师。目标是通过仿真平台验证ADRC的有效性,并为实际工程项目提供理论支持和技术指导。 其他说明:尽管ADRC具有诸多优点,但在实际应用中仍需注意参数选择和硬件条件限制等问题。

    《网络设备安装与调试(锐捷版)》项目1-配置交换机设备-优化网络传输.pptx

    《网络设备安装与调试(锐捷版)》项目1-配置交换机设备-优化网络传输.pptx

    ABAQUS UMAT/VUMAT子程序二次开发:基于Fortran实现材料损伤断裂弹塑性建模

    内容概要:本文详细介绍了如何使用Fortran语言在ABAQUS中开发UMAT(用户材料子程序)和VUMAT(显式用户材料子程序),以实现材料损伤断裂弹塑性的自定义建模。文章首先阐述了材料损伤断裂弹塑性的重要性和应用场景,强调了自定义材料子程序在处理复杂材料行为方面的优势。接着,分别展示了UMAT和VUMAT的基本代码结构及其核心计算步骤,如材料参数读取、弹性刚度矩阵初始化、塑性应变增量计算以及应力更新等。此外,还讨论了DISP模型的应用,提供了具体的损伤演化和应力折减方法,并分享了一些实用的调试技巧和注意事项。 适合人群:具备一定ABAQUS使用经验和Fortran编程基础的研究人员和技术人员,尤其是从事材料力学、结构工程等领域的工作人士。 使用场景及目标:适用于需要对特定材料进行精确建模的工程项目,如航空航天、土木建筑等。通过自定义UMAT和VUMAT子程序,能够更好地模拟材料在复杂载荷条件下的损伤演化与断裂过程,提高结构安全性和可靠性评估的准确性。 其他说明:文中不仅提供了详细的代码示例,还分享了许多实践经验,帮助开发者避免常见错误并优化性能。同时提醒读者关注材料参数的正确配置、雅可比矩阵的对称性等问题,确保计算稳定可靠。

    V1_3_example.ipynb

    V1_3_example.ipynb

    安川机器人DX100操作要领书 通用-搬运用途-E.0.pdf

    安川机器人DX100操作要领书 通用-搬运用途-E.0.pdf

    【java毕业设计】SpringBoot+Vue图书馆(图书借阅)管理系统 源码+sql脚本+论文 完整版

    这个是完整源码 SpringBoot + vue 实现 【java毕业设计】SpringBoot+Vue图书馆(图书借阅)管理系统 源码+sql脚本+论文 完整版 数据库是mysql 随着社会的发展,计算机的优势和普及使得阿博图书馆管理系统的开发成为必需。阿博图书馆管理系统主要是借助计算机,通过对图书借阅等信息进行管理。减少管理员的工作,作,同时也方便广大用户对所需图书借阅信息的及时查询以及管理。 阿博图书馆管理系统的开发过程中,采用B / S架构,主要使用Java技术进行开发,结合最新流行的springboot框架。使用Mysql数据库和Eclipse开发环境。该阿博图书馆馆管理系统的开发过程中,采用B / S架构,主要使用Java技术进行开发,结合最新流行的spri管理系统包括用户和管理员。其主要功能包括管理员:首页、个人中心、用户管理、图书分类管理、图书信息管理、图书借阅管理、图书归还管理、缴纳罚金管理、留言板管理、系同时也方便广大用户对所需图书借阅信息的及时查询以及管理。 阿博图书馆管理系统的开发过程中,采用B / S架构,主要使用Java技术进行开发,结合最新流行的springboot框架。使用Mysql数据库和Eclipse开发环境。该阿博图书馆管理系统包括用户和管理员。其主要功能包括管理员:首页、个人中心、用户管理、图书分类管理、图书信息管理、图书借阅管理、图书归还管理、缴纳罚金管理、留言板管理、系统管理,用户:首页、个人中心、图书借阅管理、图书归还管理、缴纳罚金管理、我的收藏管理,前台首页;首页、图书信息、公告信息、留言反馈、个人中心、后台管理等功能。 本论文对阿博图书馆管理系统的发展背景进行详细的介绍,并且对系统开发技术进行介绍,然后对系统进行需求分析,对阿博图书馆管理系统业务流程、系统结构以及数据都进行详细说明。用户可根据关键字进行查找自己想要的信息等。

    基于YALMIP与MATLAB的微电网优化调度模型:新手友好型学习教程

    内容概要:本文详细介绍了一个基于YALMIP和MATLAB的微电网优化调度模型,旨在帮助新手理解和应用微电网优化调度的基本概念和技术。模型综合考虑了蓄电池管理、市场购电售电约束以及功率平衡等因素,以实现系统总费用最低为目标。文中提供了详细的MATLAB代码示例,涵盖变量定义、约束条件建立、目标函数设定及优化求解过程,并附带了调试建议和可视化方法。此外,还讨论了一些常见的错误及其解决办法,如充放电互斥约束、功率平衡约束等。 适合人群:对微电网优化调度感兴趣的初学者,尤其是有一定MATLAB基础的学生或研究人员。 使用场景及目标:适用于希望快速掌握微电网优化调度基本原理的学习者,通过动手实践加深对相关理论的理解。具体应用场景包括但不限于:学术研究、课程作业、个人兴趣项目等。 其他说明:该模型不仅有助于理解微电网的工作机制,还可以为进一步探索复杂的微电网优化问题奠定坚实的基础。

    基于MATLAB的CNN多输入多输出预测模型构建与应用

    内容概要:本文详细介绍了如何利用MATLAB搭建卷积神经网络(CNN),用于处理具有10个输入特征和3个输出变量的数据预测任务。首先进行数据预处理,包括数据读取、归一化以及训练集和测试集的划分。接着设计了一个包含多个卷积层、批量归一化层、ReLU激活函数层和全连接层的网络架构,确保能够有效提取特征并完成多输出预测。训练过程中采用Adam优化算法,并设置了合理的超参数如最大迭代次数、批次大小和初始学习率等。最终通过预测和反归一化步骤得到模型性能评价指标MAE和R²,展示了良好的预测效果。 适合人群:具有一定MATLAB编程基础和技术背景的研究人员或工程师,尤其是那些从事数据分析、机器学习领域的专业人士。 使用场景及目标:适用于需要解决多输入多输出预测问题的实际项目中,比如工业生产过程监控、设备故障诊断等领域。目的是帮助用户掌握使用MATLAB实现CNN的方法论,从而提高工作效率和解决问题的能力。 其他说明:文中提供了完整的代码片段供读者参考实践,同时针对可能出现的问题给出了实用性的建议,如调整批量大小、降低学习率等方法来应对训练不稳定的情况。此外还提到了一些改进方向,例如改变卷积核尺寸或者引入空洞卷积以增强模型表现。

    机器人概要(外形图、目录的阅读方法)20120428.ppt

    机器人概要(外形图、目录的阅读方法)20120428.ppt

    《计算机程序设计(C语言)》第7章-第2节-函数的定义.ppt

    《计算机程序设计(C语言)》第7章-第2节-函数的定义.ppt

Global site tag (gtag.js) - Google Analytics