Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

JNI problem - SCO OpenServer 5.0.4

Posted on 1998-08-14
2
Medium Priority
?
409 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 400 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses

618 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