ZeroC ICE之Hello World java客户端

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!

你可能感兴趣的:(ICE)