QuickStart ice--using eclipse to develop ice

Source: Internet
Author: User


zeroc ICE Quick Start 1 Environment Construction

1.1 1.1 Operating environment configuration 1.2 downloads

The version that this example downloads is Ice-3.5.1-6.msi

Https://zeroc.com/download/Ice/3.5/Ice-3.5.1-6.msi

1.3 Installing the ICE operating environment

Recommended to install in the root directory, if not installed in the root directory, it is also recommended not to be installed in a directory with spaces

This example installs the directory to C:\ZeroC\Ice-3.5.1, installs simultaneously will produce a Ice-3.5.1-demos directory, there are many demo, this example installs the position to be C:\ZeroC\Ice-3.5.1-demos

Configuring Environment variables

ice_home= C:\ZeroC\Ice-3.5.1

path=%ice_home%\bin;

classpath=%ice_home%\lib\ice.jar;%i Ce_home%\lib\db.jar;%i Ce_home%\lib\freeze.jar;%i Ce_home%\lib\icebox.jar;

Check if the installation was successful

Executing slice2cpp–v in the cmd window

installation is successful as shown above

1.4 Installing the Ice development plugin

This example uses an Eclipse version of 4.5,JDK version 1.8.0_60

Open Eclipse, select Help->eclipse Marketplace

The input Zeroc ice is shown below

 

Click Install, select Ice Builder for Eclipse 4.0.0 and install

After installation, eclipse will restart, click on windows->preferemces. Configure the ICE Runtime environment

Select an ice installation directory to

2 start Ice Tour 1.1 write the ice server side

Create a new Java Project

To add an ice property to a project

This will generate two directories, as follows

Create a new ice profile in the slice directory

a). Helloword. Ice

The code is as follows:

Module com

{

Modulemyice

{

Moduletest

{

Interfacehelloworld

{

Stringsayhello (string s);

};

};

};

};

 

b). Writing servant

Hellowordldi.java

Package com.myice.servant;

import Com.myice.test._helloworlddisp;

Import Ice.current;

Public class Hellowordldi extends _helloworlddisp{

@Override

Public Stringprintstring (String s,current __current) {

System. out. println ("Client message:" +s);

return "Hello World:" +s;

}

}

 

c). Publish servant using code, write server

Iceserver.java

Package com.myice.server;

import Com.myice.servant.HelloWordldI;

Public class Iceserver extends ice.application{

Public Static void Main (string[] a) {

Iceserver app = new iceserver ();

string[]args={"", ""};

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.