Solved

JNI problem - SCO OpenServer 5.0.4

Posted on 1998-08-14
2
394 Views
Last Modified: 2013-12-05
Development platform: SCO OpenServer 5.0.4 (SCO JDK 1.1-1).
I have a problem when I try to use JNI.
I cannot create a shared library file because "jni.h" file which is included in my header file (generated :
javah -jni my_java_file ) includes "jni_md.h" file. And the only "jni_md.h" file I have is the one in ./unixware directory.
That file is for UnixWare and there is a type "long long" (64 bits) in it . I use OpenServer and there is no such type.
What should I do to avoid that problem ? Where can I get an example "Writing native methods for Java" for OpenServer ?
0
Comment
Question by:komitski
2 Comments
 
LVL 4

Accepted Solution

by:
evijay earned 100 total points
ID: 1232734
Get the SCO UnixWare/OpenServer Development Kit (UDK) and compile

see
http://www.sco.com/java/jdk113/ReleaseNotes.html#NMI

See the following excerpt from sco release notes documentation

Native Methods

Both the JNI-style native methods added as of JDK 1.1 and the old-style, lower-level native methods from JDK 1.0.2 are supported in
this release.

C and C++ native methods must be compiled and linked with the SCO UnixWare/OpenServer Development Kit (UDK). This means
that native methods cannot be built with the existing development kit on OpenServer or UnixWare 2.

Some of the reasons for this requirement include:

    native methods need the C/C++ 64-bit long long data type, to match the Java 64-bit long data type

    C++ native methods need for the C++ standard library to be a dynamic library (libC.so) rather than an archive (libC.a)

    native methods using X must reference X11R6 headers, since that is what the JDK AWT uses

    native methods must use the same calling conventions, header files, and libraries as the JVM, which has itself been built with the
    UDK

All of these items are in the UDK but not in the existing development kit on OpenServer and UnixWare 2.1.2. The UDK can be used
either on OpenServer or UnixWare 2.1.2 itself, or native method dynamic libraries can be built with the UDK on UnixWare 7 Gemini
then moved to OpenServer or UnixWare 2.1.2.

Another important limitation with native methods is upon the kinds of system operations that a native method can do. In particular:

    a native method cannot make use of the threads library, libthread.so from UnixWare 2.1.2 or UnixWare 7.
    direct native methods access to commercial database systems is potentially hazardous due to inappropriate system-level usages
    by the DBMSes conflicting with the JVM; use JDBC instead

SCO-specific examples of the commands needed to build old- and new-style native methods with C and C++ are included in the
demos part of the JDK 1.1.3 (in the jdk113pls package), under the subdirectories native_c_demo, jni_c_demo,
native_c++_demo, and jni_c++_demo.
0
 

Author Comment

by:komitski
ID: 1232735
Thank you !
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unix, date minus 1, 2 or 3 days (last working day) 11 53
Java string replace 11 48
Android development question 2 37
login form jsp example 2 26
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question