ppc64le处理器国产power8服务器CentOS7.2安装ibm-jdk

ppc64le处理器国产power8服务器CentOS7.2安装ibm-jdk

先来看一下服务器信息

// 首先尝试按照我之前这篇https://blog.csdn.net/frdevolcqzyxynjds/article/details/103162959安装

本地windows上传到服务器

查看是否上传成功

查看磁盘空间

在 /run下新建一个目录 java

从 ~目录 解压到 /run/java 目录

换一种方式,先解压到当前目录,在移动到/run/java目录

解压失败

-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------

此时再换另一套思路,就是换了一台机子,这次根目录大了

并且本地windows上传到 /opt/soft 目录下

在当前目录下解压

查看一下确定一下是否解压成功

设置环境变量
        编辑配置文件
        vi /etc/profile

        # 配置文件(最好在末尾)追加Java环境变量
        export JAVA_HOME=/opt/soft/jdk1.8.0_112
        export PATH=$PATH:$JAVA_HOME/bin
生效配置文件
        source  /etc/profile
查看java版本
        java -version

但是,下面却出现

-bash: /opt/soft/jdk1.8.0_112/bin/java: cannot execute binary file

不能执行二进制文件

授权一下试试

chmod 777 /opt/soft/jdk1.8.0_112/bin/java

不行

然后想到

原因是安装jdk的版本和linux系统版本对不上,把64位的jdk版本移到32位上面安装了,所以会出现上面的问题。

先查看一下版本

getconf LONG_BIT

是64位,没问题

下载的某些程序非二进制包,可以直接执行的,但却出现该问题,也是因为内核匹配不了CPU,

intel是x86的,amd是amd64或是32位版本,对应清楚下载

于是我就在想啊,试试jdk-8u231-linux-i586.tar.gz 这个,

结果也不行


下面才是主体

power8是ppc64le,不是intel也不是amd,所以x86,x64都不行

没有办法,自己解决不掉,这才想到另外一个办法,就是下载并安装和ppc64le相匹配的jdk

在百度上搜索找到下面这老哥发的博客

cpu架构为power的JDk部署 jdk7 ppc64
 

然后自己试了一下

1、本地上传到服务器
上传之后查看文件权限
[root@admin java]# ll
total 174508
-rw-r--r--. 1 root root 178692703 Nov 22 09:40 ibm-java-ppc64le-sdk-8.0-5.41.bin

2、先加权限再安装
# chmod a+x ibm-java-ppc64le-sdk-8.0-5.41.bin

# ./ibm-java-ppc64le-sdk-8.0-5.41.bin

3、配置文件   (jdk目录 /opt/ibm/java-ppc64le-80 )
# vi /etc/profile

	JAVA_HOME=/opt/ibm/java-ppc64le-80
	JRE_HOME=/home/ibm/java-ppc64le-80/jre
	PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
	CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:
	export JAVA_HOME JRE_HOME PATH CLASSPATH

4、生效配置文件
# source /etc/profile  

5、查看是否有版本信息  
# java -version

下面是详细过程

请看下面

------------------------------------------
[root@admin java]# 
[root@admin java]# ll
total 174508
-rw-r--r--. 1 root root 178692703 Nov 22 09:40 ibm-java-ppc64le-sdk-8.0-5.41.bin
[root@admin java]# 
[root@admin java]# chmod a+x ibm-java-ppc64le-sdk-8.0-5.41.bin
chmod: missing operand after ‘a+x ibm-java-ppc64le-sdk-8.0-5.41.bin’
Try 'chmod --help' for more information.
[root@admin java]# 
[root@admin java]# ll
total 174508
-rw-r--r--. 1 root root 178692703 Nov 22 09:40 ibm-java-ppc64le-sdk-8.0-5.41.bin
[root@admin java]# 
[root@admin java]# chmod +x ibm-java-ppc64le-sdk-8.0-5.41.bin
chmod: missing operand after ‘+x ibm-java-ppc64le-sdk-8.0-5.41.bin’
Try 'chmod --help' for more information.
[root@admin java]# 
[root@admin java]# ll
total 174508
-rw-r--r--. 1 root root 178692703 Nov 22 09:40 ibm-java-ppc64le-sdk-8.0-5.41.bin
[root@admin java]# 
[root@admin java]# chmod 777 ibm-java-ppc64le-sdk-8.0-5.41.bin
chmod: missing operand after ‘777 ibm-java-ppc64le-sdk-8.0-5.41.bin’
Try 'chmod --help' for more information.
[root@admin java]# 
[root@admin java]# chmod a+x ibm-java-ppc64le-sdk-8.0-5.41.bin
chmod: missing operand after ‘a+x ibm-java-ppc64le-sdk-8.0-5.41.bin’
Try 'chmod --help' for more information.
[root@admin java]# 
[root@admin java]# cat /etc/sudoers
## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
## 
## This file must be edited with the 'visudo' command.

## Host Aliases
## Groups of machines. You may prefer to use hostnames (perhaps using 
## wildcards for entire domains) or IP addresses instead.
# Host_Alias     FILESERVERS = fs1, fs2
# Host_Alias     MAILSERVERS = smtp, smtp2

## User Aliases
## These aren't often necessary, as you can use regular groups
## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname 
## rather than USERALIAS
# User_Alias ADMINS = jsmith, mikem


## Command Aliases
## These are groups of related commands...

## Networking
# Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool

## Installation and management of software
# Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum

## Services
# Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig, /usr/bin/systemctl start, /usr/bin/systemctl stop, /usr/bin/systemctl reload, /usr/bin/systemctl restart, /usr/bin/systemctl status, /usr/bin/systemctl enable, /usr/bin/systemctl disable

## Updating the locate database
# Cmnd_Alias LOCATE = /usr/bin/updatedb

## Storage
# Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount

## Delegating permissions
# Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp 

## Processes
# Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall

## Drivers
# Cmnd_Alias DRIVERS = /sbin/modprobe

# Defaults specification

#
# Refuse to run if unable to disable echo on the tty.
#
Defaults   !visiblepw

#
# Preserving HOME has security implications since many programs
# use it when searching for configuration files. Note that HOME
# is already set when the the env_reset option is enabled, so
# this option is only effective for configurations where either
# env_reset is disabled or HOME is present in the env_keep list.
#
Defaults    always_set_home
Defaults    match_group_by_gid

# Prior to version 1.8.15, groups listed in sudoers that were not
# found in the system group database were passed to the group
# plugin, if any. Starting with 1.8.15, only groups of the form
# %:group are resolved via the group plugin by default.
# We enable always_query_group_plugin to restore old behavior.
# Disable this option for new behavior.
Defaults    always_query_group_plugin

Defaults    env_reset
Defaults    env_keep =  "COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS"
Defaults    env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults    env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults    env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults    env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"

#
# Adding HOME to env_keep may enable a user to run unrestricted
# commands via sudo.
#
# Defaults   env_keep += "HOME"

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin

## Next comes the main part: which users can run what software on 
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
## 	user	MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere 
root	ALL=(ALL) 	ALL

## Allows members of the 'sys' group to run networking, software, 
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

## Allows people in group wheel to run all commands
%wheel	ALL=(ALL)	ALL

## Same thing without a password
# %wheel	ALL=(ALL)	NOPASSWD: ALL

## Allows members of the users group to mount and unmount the 
## cdrom as root
# %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom

## Allows members of the users group to shutdown this system
# %users  localhost=/sbin/shutdown -h now

## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d
[root@admin java]# chmod u+w /etc/sudoers
[root@admin java]# 
[root@admin java]# ll
total 174508
-rw-r--r--. 1 root root 178692703 Nov 22 09:40 ibm-java-ppc64le-sdk-8.0-5.41.bin
[root@admin java]# 
[root@admin java]# chmod a+x ibm-java-ppc64le-sdk-8.0-5.41.bin
chmod: missing operand after ‘a+x ibm-java-ppc64le-sdk-8.0-5.41.bin’
Try 'chmod --help' for more information.
[root@admin java]# 
[root@admin java]# chmod 777 ibm-java-ppc64le-sdk-8.0-5.41.bin
chmod: missing operand after ‘777 ibm-java-ppc64le-sdk-8.0-5.41.bin’
Try 'chmod --help' for more information.
[root@admin java]# 
[root@admin java]# sudo chmod 777 ibm-java-ppc64le-sdk-8.0-5.41.bin
chmod: missing operand after ‘777 ibm-java-ppc64le-sdk-8.0-5.41.bin’
Try 'chmod --help' for more information.
[root@admin java]# 
[root@admin java]# chmod --help
Usage: chmod [OPTION]... MODE[,MODE]... FILE...
  or:  chmod [OPTION]... OCTAL-MODE FILE...
  or:  chmod [OPTION]... --reference=RFILE FILE...
Change the mode of each FILE to MODE.
With --reference, change the mode of each FILE to that of RFILE.

  -c, --changes          like verbose but report only when a change is made
  -f, --silent, --quiet  suppress most error messages
  -v, --verbose          output a diagnostic for every file processed
      --no-preserve-root  do not treat '/' specially (the default)
      --preserve-root    fail to operate recursively on '/'
      --reference=RFILE  use RFILE's mode instead of MODE values
  -R, --recursive        change files and directories recursively
      --help     display this help and exit
      --version  output version information and exit

Each MODE is of the form '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+'.

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
For complete documentation, run: info coreutils 'chmod invocation'
[root@admin java]# 
[root@admin java]# chmod +x ibm-java-ppc64le-sdk-8.0-5.41.bin
chmod: missing operand after ‘+x ibm-java-ppc64le-sdk-8.0-5.41.bin’
Try 'chmod --help' for more information.
[root@admin java]# 
[root@admin java]# ls
ibm-java-ppc64le-sdk-8.0-5.41.bin
[root@admin java]# 
[root@admin java]# chmod a+x ibm-java-ppc64le-sdk-8.0-5.41.bin
[root@admin java]# 
[root@admin java]# ls
ibm-java-ppc64le-sdk-8.0-5.41.bin
[root@admin java]# 
[root@admin java]# ll
total 174508
-rwxr-xr-x. 1 root root 178692703 Nov 22 09:40 ibm-java-ppc64le-sdk-8.0-5.41.bin
[root@admin java]# 
[root@admin java]# 


--------------------------------------------------------------

下面是安装

[root@admin java]# ./ibm-java-ppc64le-sdk-8.0-5.41.bin 
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...

Launching installer...


Graphical installers are not supported by the VM. The console mode will be used instead...

===============================================================================
Choose Locale...
----------------

    1- Bahasa Indonesia
    2- Català
    3- Deutsch
  ->4- English
    5- Español
    6- Français
    7- Italiano
    8- Português

CHOOSE LOCALE BY NUMBER: 4
===============================================================================
IBM® 64-bit SDK for Linux®, v8.0                 (created with InstallAnywhere)
-------------------------------------------------------------------------------

Preparing CONSOLE Mode Installation...




===============================================================================


 
 
    International License Agreement for Non-Warranted Programs
    
    Part 1 - General Terms
    
    BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, CLICKING ON AN
    "ACCEPT" BUTTON, OR OTHERWISE USING THE PROGRAM, LICENSEE AGREES TO
    THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCEPTING THESE TERMS ON
    BEHALF OF LICENSEE, YOU REPRESENT AND WARRANT THAT YOU HAVE FULL
    AUTHORITY TO BIND LICENSEE TO THESE TERMS. IF YOU DO NOT AGREE TO
    THESE TERMS,
    
    * DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, CLICK ON AN "ACCEPT" BUTTON,
    OR USE THE PROGRAM; AND
    
    * PROMPTLY RETURN THE UNUSED MEDIA AND DOCUMENTATION TO THE PARTY FROM
    WHOM IT WAS OBTAINED FOR A REFUND OF THE AMOUNT PAID. IF THE PROGRAM
    WAS DOWNLOADED, DESTROY ALL COPIES OF THE PROGRAM.
    
    1. Definitions
 
Press Enter to continue viewing the license agreement, or enter "1" to 
   accept the agreement, "2" to decline it, "3" to print it, or "99" to go back
   to the previous screen.: 1

===============================================================================
Introduction
------------

InstallAnywhere will guide you through the installation of IBM® 64-bit SDK for 
Linux®, v8.0.

It is strongly recommended that you quit all programs before continuing with 
this installation.

Respond to each prompt to proceed to the next step in the installation.  If you
want to change something on a previous step, type 'back'.

You may cancel this installation at any time by typing 'quit'.

PRESS <ENTER> TO CONTINUE: 


===============================================================================
Choose Install Folder
---------------------

Where would you like to install?

  Default Install Folder: /opt/ibm/java-ppc64le-80

ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
      : 

===============================================================================
Pre-Installation Summary
------------------------

Please Review the Following Before Continuing:

Product Name:
    IBM® 64-bit SDK for Linux®, v8.0

Install Folder:
    /opt/ibm/java-ppc64le-80

Link Folder:
    /root

Disk Space Information (for Installation Target): 
    Required:  324,864,589 Bytes
    Available: 37,478,400,000 Bytes

PRESS <ENTER> TO CONTINUE: 


===============================================================================
Installing...
-------------

 [==================|==================|==================|==================]
 [------------------|------------------|------------------|------------------]



===============================================================================
Installation Complete
---------------------

Congratulations. IBM® 64-bit SDK for Linux®, v8.0 has been successfully 
installed to:

   /opt/ibm/java-ppc64le-80

PRESS <ENTER> TO EXIT THE INSTALLER: 

[root@admin java]# 
[root@admin java]#

-------------------------------------
下面查看安装的jdk目录

[root@admin java]# ll /opt/ibm/java-ppc64le-80
total 12140
drwxrwxr-x.  2 root root     4096 Nov 22 10:00 bin
-rwxrwxr-x.  1 root root      668 Sep 19 18:52 copyright
drwxrwxr-x. 12 root root      201 Nov 22 10:00 demo
drwxrwxr-x. 24 root root      235 Nov 22 10:00 docs
drwxrwxr-x.  3 root root      163 Nov 22 10:00 include
drwxrwxr-x.  6 root root       62 Sep 19 13:47 jre
drwxrwxr-x.  3 root root      137 Nov 22 10:00 lib
-rwxrwxr-x.  1 root root    57012 Sep 19 18:52 license_en.txt
-rwxrwxr-x.  1 root root   339198 Sep 19 18:52 notices.txt
drwxrwxr-x.  3 root root       21 Nov 22 10:00 properties
-rwxrwxr-x.  1 root root      896 Sep 19 18:52 readme.txt
-rwxrwxr-x.  1 root root       86 Sep 19 18:52 release
drwxrwxr-x. 11 root root      186 Nov 22 10:00 sample
-rwxrwxr-x.  1 root root 12014310 Sep 19 18:52 src.zip
drwxrwxr-x.  2 root root        6 Nov 22 10:00 sun_attach
drwxr-xr-x.  3 root root      174 Nov 22 10:00 _uninstall
[root@admin java]#

---------------------------------------------
下面查看修改配置文件

[root@admin java]# cat /etc/profile

[root@admin java]# vi /etc/profile

# 记住jdk目录是    /opt/ibm/java-ppc64le-80


# 配置文件(最好在末尾)追加Java环境变量
JAVA_HOME=/opt/ibm/java-ppc64le-80
JRE_HOME=/home/ibm/java-ppc64le-80/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:
export JAVA_HOME JRE_HOME PATH CLASSPATH


-- INSERT --
:wq

[root@admin java]# 

----------------------------
下面生效配置文件

[root@admin java]# source /etc/profile
[root@admin java]# 

--------------------------
下面查看java环境是否安装好

[root@admin java]# java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 8.0.5.41 - pxl6480sr5fp41-20190919_01(SR5 FP41))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux ppc64le-64-Bit Compressed References 20190911_427071 (JIT enabled, AOT enabled)
OpenJ9   - d581d49
OMR      - ca4db84
IBM      - 5cfdf9c)
JCL - 20190918_01 based on Oracle jdk8u221-b11
[root@admin java]# 
[root@admin java]#


终于成功了
--------------------------------
等一下,写个java测试类检测一下
[root@admin ~]# vi test.java
[root@admin ~]# 
[root@admin ~]# cat test.java 
public class test{
	public static void main(String[] args){
		System.out.println("hello world!");
		System.out.println("test successful!");
	}
}
[root@admin ~]#
[root@admin ~]# javac test.java 
[root@admin ~]# 
[root@admin ~]# ll
total 8
-rw-r--r--. 1 root root 448 Nov 22 10:24 test.class
-rw-r--r--. 1 root root 145 Nov 22 10:23 test.java
[root@admin ~]# 
[root@admin ~]# java test
hello world!
test successful!
[root@admin ~]# 
[root@admin ~]#

下一篇安装openjdk

发布了149 篇原创文章 · 获赞 37 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/frdevolcqzyxynjds/article/details/103304447