我所用的BC是borland网站免费下载的命令行编译器。以下是各文件清单,最后在生成DLL时出现的错误是
“ Unable to execute command 'ilink32.exe'”
/*  firstJNI.java */
class firstJNI
{
    public native void displayHelloWorld();
    public native void displayOther();
    private native String getLine(String prompt);    static {
     System.loadLibrary("firstJNI");//This is firstJNI.DLL
     /*if generated by borland
     System.loadLibrary("firstjni");//This is firstjni.dll
     */
    }
    
     public static void main(String[] args) 
        {
    firstJNI JN=new firstJNI();
        JN.displayHelloWorld();
    JN.displayOther();
        
        String input = JN.getLine("Enter Some Thing "); 
    System.out.println("You Entered " + input);         }
}
/* end of firstJNI.java  */
/*  firstJNI.h *//* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class firstJNI */#ifndef _Included_firstJNI
#define _Included_firstJNI
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     firstJNI
 * Method:    displayHelloWorld
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_firstJNI_displayHelloWorld
  (JNIEnv *, jobject);/*
 * Class:     firstJNI
 * Method:    displayOther
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_firstJNI_displayOther
  (JNIEnv *, jobject);/*
 * Class:     firstJNI
 * Method:    getLine
 * Signature: (Ljava/lang/String;)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_firstJNI_getLine
  (JNIEnv *, jobject, jstring);#ifdef __cplusplus
}
#endif
#endif
/* end of firstJNI.h */
/* firstJNI.c */#include <jni.h>
#include "firstJNI.h"
#include <stdio.h>
JNIEXPORT void JNICALL 
Java_firstJNI_displayHelloWorld(JNIEnv *env, jobject obj) 
{
    printf("Hello world! This DLL was generated using Borland Compiler \n");
    return;
}
JNIEXPORT void JNICALL 
Java_firstJNI_displayOther(JNIEnv *env, jobject obj) 
{printf("Hello world! This is Other Function. This DLL was generated using Borland Compiler \n");
    
}  
JNIEXPORT jstring JNICALL
Java_firstJNI_getLine(JNIEnv *env, jobject obj, jstring enter)
{
    char buf[128];
    const char *str = (*env)->GetStringUTFChars(env, enter, 0);
    printf("%s", str);
    (*env)->ReleaseStringUTFChars(env, enter, str);    scanf("%s", buf);
    return (*env)->NewStringUTF(env, buf);}
/* end of firstJNI.c *//* bcc32.cfg */
-Ic:\borland\bcc55\include;f:\jdk1.1.8\include;f:\jdk1.1.8\include\win32
-Lc:\borland\bcc55\lib;c:\borland\bcc55\lib\psdk
/* end of bcc32.cfg */