Solved

JNI problem - SCO OpenServer 5.0.4

Posted on 1998-08-14
2
397 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to see all occupied ports on windows 10 laptop 15 76
jsp insert to database example 2 46
java example issue 3 23
swing controls 2 16
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

860 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