The Ice installer for Windows optionally allows you to install a collection of sample programs in the directory of your choosing. Sample programs are provided for C++, Java, Android, C#, Visual Basic, Ruby, Python and PHP. Below you will find build instructions for languages, compilers, and target platforms. These instructions assume that you have configured your system according to the instructions in the release notes.
On this page:
The Visual Studio project files require the Ice Visual Studio Add-In, which is installed with the Ice binary distribution. |
The C++ demos are in the demo directory.
To build the C++ demos, start Visual Studio and open the solution demo\demo.sln. The demo projects were created with Visual Studio 2010 and will be converted if you are using a new version of Visual Studio.
Select your target configuration: Debug or Release, Win32 or x64 (on supported x64 platforms). Right click on the desired demo in the Solution Explorer window and select "Build".
To run a demo, open a command window and change to the desired demo subdirectory. Review the README file if one is present. Type server to start the server. In another command window, type client to start the client.
This distribution also includes a few demos for integrating Ice with Oracle. Open the solution demo\demo-oracle.sln in Visual Studio 2010SP1 to build the corresponding projects.
Visual C++ Express does not support the the Ice Visual Studio Add-In, therefore you must use NMAKE to build the C++ demos. |
The C++ demos are in the demo directory.
To build the C++ demos, open a "Visual Studio Command Prompt" window. If you installed Ice in a non-default location, set ICE_HOME as shown below:
{zcode}
> set ICE_HOME=<Ice installation root directory>
{zcode} |
Change to the demo directory and run the following command to build the demos:
{zcode}
> nmake /f Makefile.mak
{zcode} |
To run a demo, change to the desired demo subdirectory and review the README file if one is present. Type server to start the server. In another command window, type client to start the client.
Two of the Ice demos require the Microsoft Foundation Classes (MFC). These demos will not compile because the Express edition does not include MFC support. The demos are located in |
The Visual Studio project files require the Ice Visual Studio Add-In, which is installed with the Ice binary distribution. |
The C++ demos are in the demo directory.
WinRT requires Windows 8 with Visual Studio 2012, or Windows 8.1 with Visual Studio 2013. You can choose from two solutions:
demo\demo-winrt.sln - Targets Windows 8, supports Visual Studio 2012 and 2013demo\demo-winrt-8.1.sln - Targets Windows 8.1, supports Visual Studio 2013 onlyTo build the C++ WinRT demos, start Visual Studio and open the desired solution.
Select your target configuration: Debug or Release, Win32 or x64 (on supported x64 platforms). Right click on the desired demo in the Solution Explorer window and select "Build".
To run a demo, review the README file in the desired demo subdirectory.
To run the demos with a device such as Surface, you will also need to re-create the server certificate to try out SSL. The Windows RT SSL implementation requires the certificate's common name to match the IP address or DNS name of the target server. We provide a makewinrtcerts.py Python script to re-generate the server certificate in the certs directory at the root of the Ice demo distribution. To run the script:
C:\Users\acme\Documents\ZeroC\Ice-3.5.1-demos> cd certs C:\Users\acme\Documents\ZeroC\Ice-3.5.1-demos\certs> makewinrtcerts.py 192.168.1.50 |
In the example above, the server certificate's common name will be set to 192.168.1.50. The certificate is generated in the certs\winrt directory. You should specify the IP address of the machine running the SSL server here.
Sample programs are provided for C# and Visual Basic.
The Visual Studio project files require the Ice Visual Studio Add-In, which is installed with the Ice binary distribution. |
The C# demos are in the democs directory.
To build a C# demo, start Visual Studio and open the solution democs\demo.sln. Right click on the desired demo in the Solution Explorer window and select "Build".
The Visual Studio project files require the Ice Visual Studio Add-In, which is installed with the Ice binary distribution. |
The Visual Basic demos are in the demovb directory.
To build a Visual Basic demo, start Visual Studio and open the solution demovb\demo.sln. Right click on the desired demo in the Solution Explorer window and select "Build".
To run a demo, open a command window, change to the desired demo subdirectory and review the README file if one is present. Type server to start the server. In another command window, type client to start the client.
In order to use SSL with the sample programs, an SSL certificate must be installed on your system. The configuration files handle this for you, but you will be presented with a confirmation dialog the first time you run a sample program that uses SSL.
Once you are finished with the sample programs, follow these steps to remove the certificate:
The Visual Studio project files require the Ice Visual Studio Add-In, which is installed with the Ice binary distribution. |
The demos for the .NET Compact Framework are located in the democs\Ice\compact subdirectory.
To build the demo, start Visual Studio 2008 and open the solution democs\democf.sln. Right click on the demo in the Solution Explorer window and select "Build".
Review the README.txt file in the demo project for instructions on starting a device emulator and deploying the program.
The Visual Studio project files require the Ice Visual Studio Add-In, which is installed with the Ice binary distribution. |
The demos for Silverlight are located in democs\Ice\sl and democs\Glacier2\sl subdirectories.
To build the demo, start Visual Studio and open the solution democs\demosl.sln. Right click on the demo in the Solution Explorer window and select "Build".
To run a demo review the README.txt file in the demo project.
The Java demos are in the demoj directory.
To build the Java demos, you need J2SE SDK 1.6.0 or later, and Ant 1.7.0 or later. They can be downloaded from:
http://www.oracle.com/technetwork/java/javase/overview/index.html
http://ant.apache.org/bindownload.cgi
The ant bin directory must be added to your PATH, and the following environment variables need to be defined:
{zcode}
> set JAVA_HOME=<Java SDK installation root directory>
> set PATH=<Ice installation root directory>\bin;%PATH%
{zcode} |
If you installed Ice in a non-default location, set ICE_HOME as shown below:
{zcode}
> set ICE_HOME=<Ice installation root directory>
{zcode} |
You can build all of the demos by running ant in the demoj directory, or you can build individual demos by changing to the desired subdirectory and then running ant.
Before running the demos you must modify your CLASSPATH as follows:
{zcode}
> set CLASSPATH=classes;%CLASSPATH%
{zcode} |
Your CLASSPATH should also include Ice.jar, Freeze.jar, and other service-specific JAR files, as per the Release Notes instructions.
To run a demo, open a command window, change to the desired demo directory, and type java Server to run the server. In a separate command window, type java Client to run the client.
Some demo directories contain README files if additional requirements are necessary.
Several sample Android projects are provided in the demoj/android subdirectory. You must use Eclipse and the Slice2Java plug-in to build these projects.
In Eclipse, you can open a sample project by choosing File->Import...; in the "General" group, select "Existing Project into Workspace", then open one of the subdirectories of demoj/android.
The sample projects are configured to locate the Ice run time JAR file (Ice.jar) via the ICE_HOME classpath variable.
If you installed Ice.jar in a different location, you will need to add it as an external JAR file in each sample project:
Ice.jarAfter successfully building an Android project, deploy it onto a suitable emulator or device and review the README file in the project subdirectory for further instructions.
The Python demos are in the demopy directory.
You need Python 3.3 to run the demos. A binary installer for Python can be downloaded from:
http://www.python.org/download
To run a demo, open a command window, change to the desired demo directory, and type python Server.py to start the server. In a separate command window, type python Client.py to run the client.
The Ruby demos are in the demorb directory.
You need Ruby 1.9.3 to run the demos. A binary installer for Ruby can be downloaded from:
http://rubyinstaller.org/downloads/
Since Ice for Ruby does not support server-side activities, only clients are provided in the demos. In order to run the demos you must use the corresponding C++ server.
For example, to run the hello application in demo\Ice\hello, we begin by starting the C++ server:
{zcode}
> cd <Ice demo root directory>\demo\Ice\hello
> server
{zcode} |
Then in a separate command window, start the Ruby client:
{zcode}
> cd <Ice demo root directory>\demorb\Ice\hello
> ruby Client.rb
{zcode} |
PHP demos are provided in the demophp directory.
You will need PHP 5.4 to run the demos. It can be downloaded from:
http://www.php.net/downloads.php
Building the demos requires Microsoft NMAKE. If you do not already have NMAKE installed, you can download it as part of the Windows Platform SDK:
Open a command window. If you installed Ice in a non-default location, set ICE_HOME as shown below:
{zcode}
> set ICE_HOME=<Ice installation root directory>
{zcode} |
Change to the demophp directory and run the following command to build the demos:
{zcode}
> nmake /f Makefile.mak
{zcode} |
The examples in demophp\Ice\hello and demophp\Glacier2\hello demonstrate using the Ice extension for PHP in a dynamic Web page, whereas the example in demophp\Ice\value requires PHP's command-line interpreter. A README file is provided in each of the example directories.