CentOS 6.X 和 5.X 自带有OpenJDK runtime environment  (openjdk)。它是一个在linux上实现开源的java 平台。CentOS  yum 命令 安装 Java SDK openjdk

centos linux JAVA(openjdk)软件包名
1.java-1.7.0-openjdk - OpenJDK Runtime Environment
2.java-1.7.0-openjdk-devel - OpenJDK Development Environment

输入以下命令,以查看可用的JDK软件包列表;
[root@dabu.info ~]# yum search java | grep -i --color JDK

输出类似下图:

centos-openjdk

在CentOS linux安装 JAVA SDK
在命令行终端以root用户 输入以下命令yum安装 OpenSDK :
[root@dabu.info ~]#yum install java-1.7.0-openjdk  java-1.7.0-openjdk-devel  #安装openjdk

输出如下:
Loaded plugins: downloadonly, fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.wiredtree.com
 * epel: mirror.steadfast.net
 * extras: bay.uchicago.edu
 * updates: mirror.team-cymru.org
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package java-1.7.0-openjdk.x86_64 1:1.7.0.51-2.4.4.1.el6_5 will be installed
--> Processing Dependency: jpackage-utils >= 1.7.3-1jpp.2 for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: xorg-x11-fonts-Type1 for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: tzdata-java for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: rhino for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libpulse.so.0(PULSE_0)(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency:
libasound.so.2(ALSA_0.9.0rc4)(64bit) for package:
1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libasound.so.2(ALSA_0.9)(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libpulse.so.0()(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libgif.so.4()(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libasound.so.2()(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libXtst.so.6()(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Running transaction check
---> Package alsa-lib.x86_64 0:1.0.22-3.el6 will be installed
---> Package giflib.x86_64 0:4.1.6-3.1.el6 will be installed
--> Processing Dependency: libSM.so.6()(64bit) for package: giflib-4.1.6-3.1.el6.x86_64
--> Processing Dependency: libICE.so.6()(64bit) for package: giflib-4.1.6-3.1.el6.x86_64
---> Package jpackage-utils.noarch 0:1.7.5-3.12.el6 will be installed
---> Package libXtst.x86_64 0:1.2.1-2.el6 will be installed
---> Package pulseaudio-libs.x86_64 0:0.9.21-14.el6_3 will be installed
--> Processing Dependency: libsndfile.so.1(libsndfile.so.1.0)(64bit) for package: pulseaudio-libs-0.9.21-14.el6_3.x86_64
--> Processing Dependency: libsndfile.so.1()(64bit) for package: pulseaudio-libs-0.9.21-14.el6_3.x86_64
--> Processing Dependency: libasyncns.so.0()(64bit) for package: pulseaudio-libs-0.9.21-14.el6_3.x86_64
---> Package rhino.noarch 0:1.7-0.7.r2.2.el6 will be installed
--> Processing Dependency: jline for package: rhino-1.7-0.7.r2.2.el6.noarch
---> Package tzdata-java.noarch 0:2013i-2.el6 will be installed
---> Package xorg-x11-fonts-Type1.noarch 0:7.2-9.1.el6 will be installed
--> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-9.1.el6.noarch
--> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-9.1.el6.noarch
--> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.2-9.1.el6.noarch
--> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.2-9.1.el6.noarch
--> Running transaction check
---> Package jline.noarch 0:0.9.94-0.8.el6 will be installed
---> Package libICE.x86_64 0:1.0.6-1.el6 will be installed
---> Package libSM.x86_64 0:1.2.1-2.el6 will be installed
---> Package libasyncns.x86_64 0:0.8-1.1.el6 will be installed
---> Package libsndfile.x86_64 0:1.0.20-5.el6 will be installed
--> Processing Dependency: libvorbisenc.so.2()(64bit) for package: libsndfile-1.0.20-5.el6.x86_64
--> Processing Dependency: libvorbis.so.0()(64bit) for package: libsndfile-1.0.20-5.el6.x86_64
--> Processing Dependency: libogg.so.0()(64bit) for package: libsndfile-1.0.20-5.el6.x86_64
--> Processing Dependency: libFLAC.so.8()(64bit) for package: libsndfile-1.0.20-5.el6.x86_64
---> Package ttmkfdir.x86_64 0:3.0.9-32.1.el6 will be installed
---> Package xorg-x11-font-utils.x86_64 1:7.2-11.el6 will be installed
--> Processing Dependency: libfontenc.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.2-11.el6.x86_64
--> Processing Dependency: libXfont.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.2-11.el6.x86_64
--> Running transaction check
---> Package flac.x86_64 0:1.2.1-6.1.el6 will be installed
---> Package libXfont.x86_64 0:1.4.5-3.el6_5 will be installed
---> Package libfontenc.x86_64 0:1.0.5-2.el6 will be installed
---> Package libogg.x86_64 2:1.1.4-2.1.el6 will be installed
---> Package libvorbis.x86_64 1:1.2.3-4.el6_2.1 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
==================================================================================================
 Package                     Arch          Version                           Repository      Size
==================================================================================================
Installing:
 java-1.7.0-openjdk          x86_64        1:1.7.0.51-2.4.4.1.el6_5          updates         26 M
Installing for dependencies:
 alsa-lib                    x86_64        1.0.22-3.el6                      base           370 k
 flac                        x86_64        1.2.1-6.1.el6                     base           243 k
 giflib                      x86_64        4.1.6-3.1.el6                     base            37 k
 jline                       noarch        0.9.94-0.8.el6                    base            86 k
 jpackage-utils              noarch        1.7.5-3.12.el6                    base            59 k
 libICE                      x86_64        1.0.6-1.el6                       base            53 k
 libSM                       x86_64        1.2.1-2.el6                       base            37 k
 libXfont                    x86_64        1.4.5-3.el6_5                     updates        136 k
 libXtst                     x86_64        1.2.1-2.el6                       base            29 k
 libasyncns                  x86_64        0.8-1.1.el6                       base            24 k
 libfontenc                  x86_64        1.0.5-2.el6                       base            24 k
 libogg                      x86_64        2:1.1.4-2.1.el6                   base            21 k
 libsndfile                  x86_64        1.0.20-5.el6                      base           233 k
 libvorbis                   x86_64        1:1.2.3-4.el6_2.1                 base           168 k
 pulseaudio-libs             x86_64        0.9.21-14.el6_3                   base           462 k
 rhino                       noarch        1.7-0.7.r2.2.el6                  base           778 k
 ttmkfdir                    x86_64        3.0.9-32.1.el6                    base            43 k
 tzdata-java                 noarch        2013i-2.el6                       updates        147 k
 xorg-x11-font-utils         x86_64        1:7.2-11.el6                      base            75 k
 xorg-x11-fonts-Type1        noarch        7.2-9.1.el6                       base           520 k
 
Transaction Summary
==================================================================================================
Install      21 Package(s)
 
Total download size: 29 M
Installed size: 100 M
Is this ok [y/N]: y
Downloading Packages:
(1/21): alsa-lib-1.0.22-3.el6.x86_64.rpm                                   | 370 kB     00:00
(2/21): flac-1.2.1-6.1.el6.x86_64.rpm                                      | 243 kB     00:00
(3/21): giflib-4.1.6-3.1.el6.x86_64.rpm                                    |  37 kB     00:00
(4/21): java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64.rpm               |  26 MB     00:02
(5/21): jline-0.9.94-0.8.el6.noarch.rpm                                    |  86 kB     00:00
(6/21): jpackage-utils-1.7.5-3.12.el6.noarch.rpm                           |  59 kB     00:00
(7/21): libICE-1.0.6-1.el6.x86_64.rpm                                      |  53 kB     00:00
(8/21): libSM-1.2.1-2.el6.x86_64.rpm                                       |  37 kB     00:00
(9/21): libXfont-1.4.5-3.el6_5.x86_64.rpm                                  | 136 kB     00:00
(10/21): libXtst-1.2.1-2.el6.x86_64.rpm                                    |  29 kB     00:00
(11/21): libasyncns-0.8-1.1.el6.x86_64.rpm                                 |  24 kB     00:00
(12/21): libfontenc-1.0.5-2.el6.x86_64.rpm                                 |  24 kB     00:00
(13/21): libogg-1.1.4-2.1.el6.x86_64.rpm                                   |  21 kB     00:00
(14/21): libsndfile-1.0.20-5.el6.x86_64.rpm                                | 233 kB     00:00
(15/21): libvorbis-1.2.3-4.el6_2.1.x86_64.rpm                              | 168 kB     00:00
(16/21): pulseaudio-libs-0.9.21-14.el6_3.x86_64.rpm                        | 462 kB     00:00
(17/21): rhino-1.7-0.7.r2.2.el6.noarch.rpm                                 | 778 kB     00:00
(18/21): ttmkfdir-3.0.9-32.1.el6.x86_64.rpm                                |  43 kB     00:00
(19/21): tzdata-java-2013i-2.el6.noarch.rpm                                | 147 kB     00:00
(20/21): xorg-x11-font-utils-7.2-11.el6.x86_64.rpm                         |  75 kB     00:00
(21/21): xorg-x11-fonts-Type1-7.2-9.1.el6.noarch.rpm                       | 520 kB     00:00
--------------------------------------------------------------------------------------------------
Total                                                             7.2 MB/s |  29 MB     00:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libICE-1.0.6-1.el6.x86_64                                                     1/21
  Installing : 2:libogg-1.1.4-2.1.el6.x86_64                                                 2/21
  Installing : libSM-1.2.1-2.el6.x86_64                                                      3/21
  Installing : libXtst-1.2.1-2.el6.x86_64                                                    4/21
  Installing : jpackage-utils-1.7.5-3.12.el6.noarch                                          5/21
  Installing : alsa-lib-1.0.22-3.el6.x86_64                                                  6/21
  Installing : libfontenc-1.0.5-2.el6.x86_64                                                 7/21
  Installing : libXfont-1.4.5-3.el6_5.x86_64                                                 8/21
  Installing : 1:xorg-x11-font-utils-7.2-11.el6.x86_64                                       9/21
  Installing : giflib-4.1.6-3.1.el6.x86_64                                                  10/21
  Installing : flac-1.2.1-6.1.el6.x86_64                                                    11/21
  Installing : 1:libvorbis-1.2.3-4.el6_2.1.x86_64                                           12/21
  Installing : libsndfile-1.0.20-5.el6.x86_64                                               13/21
  Installing : libasyncns-0.8-1.1.el6.x86_64                                                14/21
  Installing : pulseaudio-libs-0.9.21-14.el6_3.x86_64                                       15/21
  Installing : jline-0.9.94-0.8.el6.noarch                                                  16/21
  Installing : rhino-1.7-0.7.r2.2.el6.noarch                                                17/21
  Installing : tzdata-java-2013i-2.el6.noarch                                               18/21
  Installing : ttmkfdir-3.0.9-32.1.el6.x86_64                                               19/21
  Installing : xorg-x11-fonts-Type1-7.2-9.1.el6.noarch                                      20/21
  Installing : 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64                           21/21
  Verifying  : pulseaudio-libs-0.9.21-14.el6_3.x86_64                                        1/21
  Verifying  : ttmkfdir-3.0.9-32.1.el6.x86_64                                                2/21
  Verifying  : tzdata-java-2013i-2.el6.noarch                                                3/21
  Verifying  : libXfont-1.4.5-3.el6_5.x86_64                                                 4/21
  Verifying  : libfontenc-1.0.5-2.el6.x86_64                                                 5/21
  Verifying  : flac-1.2.1-6.1.el6.x86_64                                                     6/21
  Verifying  : jline-0.9.94-0.8.el6.noarch                                                   7/21
  Verifying  : alsa-lib-1.0.22-3.el6.x86_64                                                  8/21
  Verifying  : 2:libogg-1.1.4-2.1.el6.x86_64                                                 9/21
  Verifying  : 1:libvorbis-1.2.3-4.el6_2.1.x86_64                                           10/21
  Verifying  : 1:xorg-x11-font-utils-7.2-11.el6.x86_64                                      11/21
  Verifying  : xorg-x11-fonts-Type1-7.2-9.1.el6.noarch                                      12/21
  Verifying  : libSM-1.2.1-2.el6.x86_64                                                     13/21
  Verifying  : libICE-1.0.6-1.el6.x86_64                                                    14/21
  Verifying  : 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64                           15/21
  Verifying  : rhino-1.7-0.7.r2.2.el6.noarch                                                16/21
  Verifying  : libasyncns-0.8-1.1.el6.x86_64                                                17/21
  Verifying  : giflib-4.1.6-3.1.el6.x86_64                                                  18/21
  Verifying  : libsndfile-1.0.20-5.el6.x86_64                                               19/21
  Verifying  : jpackage-utils-1.7.5-3.12.el6.noarch                                         20/21
  Verifying  : libXtst-1.2.1-2.el6.x86_64                                                   21/21
 
Installed:
  java-1.7.0-openjdk.x86_64 1:1.7.0.51-2.4.4.1.el6_5
 
Dependency Installed:
  alsa-lib.x86_64 0:1.0.22-3.el6                  flac.x86_64 0:1.2.1-6.1.el6
  giflib.x86_64 0:4.1.6-3.1.el6                   jline.noarch 0:0.9.94-0.8.el6
  jpackage-utils.noarch 0:1.7.5-3.12.el6          libICE.x86_64 0:1.0.6-1.el6
  libSM.x86_64 0:1.2.1-2.el6                      libXfont.x86_64 0:1.4.5-3.el6_5
  libXtst.x86_64 0:1.2.1-2.el6                    libasyncns.x86_64 0:0.8-1.1.el6
  libfontenc.x86_64 0:1.0.5-2.el6                 libogg.x86_64 2:1.1.4-2.1.el6
  libsndfile.x86_64 0:1.0.20-5.el6                libvorbis.x86_64 1:1.2.3-4.el6_2.1
  pulseaudio-libs.x86_64 0:0.9.21-14.el6_3        rhino.noarch 0:1.7-0.7.r2.2.el6
  ttmkfdir.x86_64 0:3.0.9-32.1.el6                tzdata-java.noarch 0:2013i-2.el6
  xorg-x11-font-utils.x86_64 1:7.2-11.el6         xorg-x11-fonts-Type1.noarch 0:7.2-9.1.el6
 
Complete!

在centos linux上设置JAVA_HOME environment variable(JAVA_HOME环境变量)

rhel 和 centos linux 使用yum命令后,将 OpenSDK 安装到/usr/lib/jvm/ 目录:
[root@dabu.info ~]# ls -l /usr/lib/jvm/

输出如下:
total 4
drwxr-xr-x. 3 root root 4096 Feb 24 17:00 java-1.7.0-openjdk-1.7.0.51.x86_64
lrwxrwxrwx. 1 root root   21 Feb 24 17:00 jre -> /etc/alternatives/jre
lrwxrwxrwx. 1 root root   27 Feb 24 17:00 jre-1.7.0 -> /etc/alternatives/jre_1.7.0
lrwxrwxrwx. 1 root root   38 Feb 24 17:00 jre-1.7.0-openjdk.x86_64 -> java-1.7.0-openjdk-1.7.0.51.x86_64/jre
lrwxrwxrwx. 1 root root   29 Feb 24 17:00 jre-openjdk -> /etc/alternatives/jre_openjdk

解释:输出的第二行的drwxr-xr-x.中的d表示是文件夹。其余的 l 表示链接。

设置JAVA_HOME指向一个含有java可执行程序的目录(一般是在 bin/java中)。我们用cd 命令进入到jvm下唯一的一个目录中 java-1.7.0-openjdk-1.7.0.51.x86_64 ,而 jre-1.7.0-openjdk.x86_64
这个链接是指向  java-1.7.0-openjdk-1.7.0.51.x86_64 这个文件夹,所以,可以直接用export命令将
JAVA_HOME 指向 jre-1.7.0-openjdk.x86_64 这个链接。
即使用export命令:
[root@dabu.info ~]#  export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64
但是这样只能在当前会话中有效,一旦注销下线,就失效了。
所以最好保存到$HOME/.bashrc文件中(这个文件是针对指定用户的,如你是叫dabu用户,那么使用dabu用户登陆,然后输入命令:echo $HOME/.bashrc,就会显示你要修改的文件路径)
找到该文件后,在文件底部添加一行,如下:
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64
修改后保存关闭文件。

或者让系统上的所有用户使用java(openjdk) ,则要进行下面的操作:
[root@dabu.info ~]#  vi  /etc/profile
将下面的三行粘贴到 /etc/profile   中:
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51.x86_64
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin

保存关闭,后,执行:
[root@dabu.info ~]#  source  /etc/profile
让设置立即生效。

在输入以下命令,来确认这三个变量是否设成了我们想要的:
[root@dabu.info ~]# echo $JAVA_HOME
[root@dabu.info ~]# echo $CLASSPATH
[root@dabu.info ~]# echo $PATH

测试java是否安装配置成功

查看 java 版本,输入命令:
[root@dabu.info ~]#  java     -version

创建一个java小程序测试下,名字叫 HelloWorld.java ,输入以下命令:
[root@dabu.info ~]# touch HelloWorld.java

将以下代码复制到 HelloWorld.java 中 :
public class HelloWorld {
pu
blic static void main(String[] args) {
System.out.println("Hello, World! This is a test code by nixCraft!");
}
}

复制进去后,保存关闭文件。编译和运行这个小程序,输入以下命令:
[root@dabu.info ~]#  javac HelloWorld.java
[root@dabu.info ~]#  java HelloWorld

会得到以下显示:
Hello, World! This is a test code by nixCraft!

如何(怎样)运行 .jar  这类java应用?

语法如下:
[root@dabu.info ~]# java -jar file.jar
[root@dabu.info ~]# java -jar /path/to/my/java/app.jar  #/path/to/my/java/app.jar表示应用的路径
[root@dabu.info ~]# java -jar /path/to/my/java/app.jar arg1 arg2   # arg1表示参数1 ,arg2表示参数2

原创文章转载请注明: CentOS 使用yum命令安装Java SDK(openjdk) | 大步's Blog

CentOS 使用yum命令安装Java SDK(openjdk)的更多相关文章

  1. CentOS7 使用yum命令安装Java SDK(openjdk)

    CentOS 6.X 和 7.X 自带有OpenJDK runtime environment  (openjdk).它是一个在linux上实现开源的java 平台. 安装方式: 1.输入以下命令,以 ...

  2. CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org

    CentOS 使用yum命令安装出现错误提示"could not retrieve mirrorlist http://mirrorlist.centos.org这个错误, 在网上找了好多, ...

  3. CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”

    刚安装完CentOS,使用yum命令安装一些常用的软件,使用如下命令:yum –y install gcc. 提示如下错误信息: Loaded plugins: fastestmirror, refr ...

  4. 【转】CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”

    源自:http://www.cnblogs.com/yangbingqi/p/3328610.html 刚安装完CentOS,使用yum命令安装一些常用的软件,使用如下命令:yum grouplist ...

  5. Centos中yum方式安装java

    查看CentOS自带JDK是否已安装.◆输入:yum list installed |grep java. 若有自带安装的JDK,如何卸载CentOS系统自带Java环境?◆卸载JDK相关文件输入:y ...

  6. CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”

    执行yum命令时出现以上错误; 解决方法: vi /etc/sysconfig/network-scripts/ifcfg-eth0 这一段为你的网卡修改图中框框部分 然后重启 :reboot

  7. CentOS下用yum命令安装jdk【转】

    一.使用yum命令安装 1.查看是否已安装JDK,卸载 [root@192 ~]# yum list installed |grep java java-1.8.0-openjdk.x86_64    ...

  8. CentOS下用yum命令安装jdk

    一.使用yum命令安装 1.查看是否已安装JDK,卸载 [root@192 ~]# yum list installed |grep java java-1.8.0-openjdk.x86_64    ...

  9. yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

    CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决 今天在虚拟机上安装完CentOS6.5之后,首次使用时yum命令安装软件时,出现 ...

随机推荐

  1. 界面绚丽的SharePoint仪表盘控件Nevron Gauge for SharePoint 控件详细介绍

    Nevron .NET Vision 是一款用于创建独特的.强大的数据表示应用程序的最终控件,它具有超强的数据可视化性能. 整合了Nevron Chart for .NET, Nevron Diagr ...

  2. WPF下制作的简单瀑布流效果

    最近又在搞点小东西,美化界面的时候发现瀑布流效果比较不错.顺便就搬到了WPF,下面是界面 我对WEB前端不熟,JS和CSS怎么实现的,我没去研究过,这里就说下WPF的实现思路,相当简单. 1.最重要的 ...

  3. Unity3D The Blacksmith Demo部分内容学习

    1.Plane Reflection 平面反射 在角色包的例子里可以看到,该脚本使用一个特定的相机渲染反射内容 官方介绍说这是优于反射探头的一种做法 2.HairRenderer 毛发渲染器 单独写的 ...

  4. Java 集合系列 16 HashSet

    java 集合系列目录: Java 集合系列 01 总体框架 Java 集合系列 02 Collection架构 Java 集合系列 03 ArrayList详细介绍(源码解析)和使用示例 Java ...

  5. leetcode:Unique Binary Search Trees

    Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For examp ...

  6. ICSharpCode.TextEditor如何自定义代码折叠和高亮

    ICSharpCode.TextEditor 是一款非常不错的.NET代码编辑控件,内置了多种高亮语言支持,同时完美支持中文,非常赞!先来看一下运行效果: 1 项目结构 这里需要注意lib文件夹下导入 ...

  7. [转载]解决sudo: sorry, you must have a tty to run sudo

    前几天遇到一个问题,在一个终端中调用另一个shell,始终是无法执行的,后来捕捉到报错信息为sudo: sorry, you must have a tty to run sudo,后来,在网上了解到 ...

  8. thinkphp5.0如何隐藏index.php入口文件

    隐藏入口文件 public/index.php 同级的.htaccess文件 [ Apache ] 方法1: <IfModule mod_rewrite.c> Options +Follo ...

  9. I/O系统(二)

    程序查询流程1测试指令,查询IO设备是否就绪.2传送指令,当已经就绪时,执行传送功能.3转移指令,未就绪时,转移至继续测试IO设备的状态.当需要启动某一IO设备时,必须将该程序插入到现行程序中.1,由 ...

  10. sshd启动报错Could not load host key

    ~ # /usr/sbin/sshd Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ ...