[root@BlueSky tv2.0]# java
Usage: gij [OPTION] ... CLASS [ARGS] ...
to invoke CLASS.main, or
gij -jar [OPTION] ... JARFILE [ARGS] ...
to execute a jar file
Try `gij --help' for more information.
于是:
[root@BlueSky tv2.0]# which java
/usr/bin/java
[root@BlueSky software]# ls /usr/bin/java -l
lrwxrwxrwx 1 root root 22 01-15 21:23 /usr/bin/java -> /etc/alternatives/java
[root@BlueSky software]# ll /etc/alternatives/java
lrwxrwxrwx 1 root root 35 05-10 13:48 /etc/alternatives/java -> /usr/lib/jvm/jre-1.4.2-gcj/bin/java
这说明java是受fc下同一软件的版本控制工具alternatives控制的,下面就是用这个工具将系统自带的GNU的java换成Sun的java版本;
查看alternatives的帮助;
[root@BlueSky software]# alternatives --help
替换选择(alternatives)的版本 1.3.30 - 版权 (C) 1997-2000 Red Hat, Inc.
在 GNU 公共许可的条款下,本软件可以被自由发行。
用法:alternatives --install <link> <name> <path> <priority>
[--initscript <service>]
[--slave <link> <name> <path>]*
alternatives --remove <name> <path>
alternatives --auto <name>
alternatives --config <name>
alternatives --display <name>
alternatives --set <name> <path>
公用选项:--verbose --test --help --usage --version
--altdir <directory> --admindir <directory>
并通过实验得到,install是安装同一软件的不同版本,remove则是移出某个版本,config则是选择当前系统使用那个版本,而display则是显示当前使用的版本,auto则是更改当前的状态为自动判断,也就是可以恢复GNU版本java的一个参数;
下面先安装jre1.5.0_09,此版本可以到sun的公司网站上下得;
[root@BlueSky software]# rpm -ivh jre-1_5_0_09-linux-i586.rpm
Preparing... ########################################### [100%]
1:jre ########################################### [100%]
检查是否安装成功:
[root@BlueSky software]# /usr/java/jre1.5.0_09/bin/java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
出现这些字样,表明jre安装成功了;
接着,使用alternatives工具增加这个版本;
[root@BlueSky software]# alternatives --install /usr/bin/java java /usr/java/jre1.5.0_09/bin/java 300 配置:
[root@BlueSky software]# alternatives --config java
共有 2 个程序提供“java”。
选择 命令
-----------------------------------------------
* 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
2 /usr/java/jre1.5.0_09/bin/java
按 Enter 来保存当前选择[+],或键入选择号码:2
[root@BlueSky software]# java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
如此,成功;
查看效果:
[root@BlueSky software]# alternatives --display java
java - 状态是手工。
链接目前指向 /
分享到:
相关推荐
Debian替代系统的另一种实现
CSS Framework Alternatives 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
CSS Framework Alternatives
下面小编就为大家带来一篇使用Linux的alternatives命令替换选择软件的版本方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
频率选择表面研究的先驱Munk老先生关于超材料研究的一些批判性思考,值得一读
update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the Debian alternatives system. It is possible for several programs fulfilling the same or ...
文章资料imaging spectropolarimeter方面的文章
"Analyzing computer system performance is often regarded by most system administrators, IT professionals and software engineers as a black art that is too time consuming to learn and apply. Finally, ...
CSS Framework Alternatives 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请...
主要介绍了linux使用update-alternatives切换java版本的相关资料,需要的朋友可以参考下
Learn how to use lightweight CSS framework alternatives to build intuitive websites. This book presents five project examples that use Skeleton, Miligram, UI Kit, Material Design Lite and Susy.
主要介绍了linux软件版本管理命令update-alternatives使用详解的相关资料,需要的朋友可以参考下
2020年06月CFA三级Flashcard_Alternatives
描述系统环境,描述系统如何与外部实体进行交互,一般使用系统图来表示。例如系统拓扑结构图。 2.2 Design Considerations 设计思路 2.2.1 Design Alternatives 设计方案 (1)架构设计思路、层与层之间关系,可用包...
8.7 Maximum Likelihood Estimation Problems and Alternatives . . . . . . . . . 222 8.8 Exact Methods in Logistic Regression . . . . . . . . . . . . . . . . . . . . . 225 8.9 Using the CATMOD and GENMOD...
基于 UNIX 的系统有两个可映射到附加内存中的基本系统调用: brk: brk() 是一个非常简单的系统调用。还记得系统中断点吗?该位置是进程映射的内存边界。 brk() 只是简单地将这个位置向前或者向后移动,就可以向...
The purpose of a distributed file system (DFS) is to allow users of physically distributed computers to share data and storage resources by using a common file system. A typical configuration for a ...
Part IV: Alternatives to Shall Requirements Chapter 12: Supplementing or Replacing Standard Requirements Chapter 13: User Stories Chapter 14: Use Cases Chapter 15: Revisiting Requirement Problems and ...
我将存储库重命名为“Awesome Alternatives in Rust”。 原来的名字是“Awesome Rewrite It In Rust”。 有关更多详细信息,请参阅。 目录 开发工具 命令运行程序 短绒 图书馆电子邮件 应用 容器 运行 youki - ...
也就是说, update-alternatives 命令可以将 系统范围 system wide 默认使用的 PHP 版本设置为我们希望的版本。通俗的来说,你可以通过 update-alternatives 命令从系统范围设置程序的版本。如果你希望可以在不同...