Solved

JNI problem - SCO OpenServer 5.0.4

Posted on 1998-08-14
2
399 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

749 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