---
title: "ZeroC ICE之Hello World java客户端"
author: "reymont"
date: "2015-08-13T20:55:16Z"
tags: ["ice"]
categories: ["开源软件"]
slug: "zeroc-ice-hello-world-java"
draft: false
lastmod: "2015-08-13T20:55:16Z"
id: 2235320
url: "https://reymont.iteye.com/blog/2235320"
---

Writing an Ice Application with Java - Ice 3.6 - ZeroC

https://doc.zeroc.com/display/Ice36/Writing+an+Ice+Application+with+Java

 

代码：https://github.com/reymont/ice

 

ZeroC - Download

https://zeroc.com/download.html

Using the Linux Binary Distributions - Ice 3.6 - ZeroC

https://doc.zeroc.com/display/Ice36/Using+the+Linux+Binary+Distributions#UsingtheLinuxBinaryDistributions-InstallingIceonRedHatEnterpriseLinux7

 

#安装 ZeroC键，避免未签名的包报警

wget https://zeroc.com/download/GPG-KEY-zeroc-release

sudo rpm --import GPG-KEY-zeroc-release

#安装 Ice的库

cd /etc/yum.repos.d

sudo wget https://zeroc.com/download/rpm/el7/zeroc-ice-el7.repo

#centos 7安装是 ice 3.6.0版本

sudo yum install ice-all-runtime ice-all-devel

 

git clone https://github.com/reymont/ice.git

 

#添加ice的配置。ice.jar默认位置为/usr/share/java/ice.jar

vim /etc/profile

export CLASSPATH=.:$JAVA\_HOME/lib/dt.jar:$JAVA\_HOME/lib/tools.jar:/usr/share/java/ice.jar

 

#编译Server和Client

javac -d classes -classpath classes:/usr/share/java/ice.jar Client.java PrinterI.java generated/Demo/\*.java

javac -d classes -classpath classes:/usr/share/java/ice.jar Server.java PrinterI.java generated/Demo/\*.java

 

#开启Server

cd classes

java Server

 

#另开一个客户端

java Client

 

\[root@localhost classes]# java Server

Hello World!