NCT Quick Start Guide

This guide shows how to use the Native Connector tool (NCT) to create native connector components that enable you to access a C shared library or a C++ shared library from a Javatrademark program.

To start the IDE, type runide.sh in a terminal window.


Enhance the Native Library

Before you can create Java classes for a shared library, you must create an enhanced version of the library by compiling and linking the library source code using the -xnativeconnect compiler option.

For more information about the -xnativeconnect compiler option, see the CC(1) man page or the cc(1) man page.



Tip - If you use the Makefile wizard to create a makefile for the library, select the enhanced native library option. This option adds -xnativeconnect to the compiler flags list.




Create a Native Connector File

1. If the directory tree that contains the enhanced native library is not mounted in the Filesystems tab of the Explorer, mount it.

See the Accessing a Directory topic in the Solaristrademark Native Languages Support online help for information about mounting directories.

2. In the Filesystems tab in the Explorer, navigate to the directory that contains the library.

3. Right-click the library and choose Create Native Connector from the contextual menu.

The New wizard appears.

4. Complete the steps and click Finish.

The IDE builds the native connector file (.cdf). The source editor is displayed with the native connector file available for editing. See Step 3 for information on how to use the editor to select the Java API.



Tip - When you click Help in the New wizard, the IDE displays help for the current step.




Select the Classes, Methods, and Members to Expose In the Java API

After you create the native connector file, you must edit the file to define the Java API. When you complete the steps in the New wizard, the wizard opens the file for editing automatically.

1. In the source editor, use one of the following procedures to pick the classes, methods, and members that you want to expose in the Java API (target wrapper API).

Use Ctrl-click to select multiple items.

2. If the IDE encounters naming conflicts, it displays a Renaming dialog that shows how it named the class, method, or field accessor to resolve the conflict. Click OK to dismiss the dialog.

3. (Optional) To change the name of a method, double-click the method in the Target Wrapper API list and type the new name.

4. To save the changes, press Ctrl-S.



Tip - To make subsequent changes to the Java API, double-click the native connector descriptor file (.cdf) in the Explorer to open it in the source editor.




Generate the Native Connector Components

1. In the Explorer, right-click the descriptor file (.cdf) and choose Execute from the contextual menu.

A dialog panel appears which shows where the generated files will go and shows the progress of each step in the generation process. System messages appear in an Output window.

2. When the dialog panel shows that the process is done, click OK.


Getting Help

To Get Help About...

Do This

Starting the IDE

See the Fortetrademark for Javatrademark Release Notes.

Using the Native Connector tool

Choose Help right arrow Helpsets right arrow Native Connector Tool Help.

Using the Solaris Native Languages Support features to create, compile, debug and analyze source code.

Choose Help right arrow Helpsets right arrow Solaris Native Languages Support Help.

Using the basic IDE features

Choose Help right arrow Help Sets right arrow Core IDE Help.

Using a window in the IDE

Click in the window. Then press F1.

Native Connector files

In the Explorer window, select the .cdf file and press F1.

Accessing the Forte Compiler Collection man pages (including API reference information), manuals, and readmes

Open the following URL in a web browser:
file:/opt/SUNWspro/docs/index.html

If your Forte Compiler Collection software is not installed in the /opt directory, ask your system administrator for the equivalent path on your system.