Solved

JNI problem - SCO OpenServer 5.0.4

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now