Where is jni.h

Hi
I was doing a tutorial by Beth Stearns at: http://java.sun.com/docs/books/tutorial/native1.1/index.html
I compiled my java file using javah -jni HelloWorld. which works fine. then i wrote the C file with the following code:
#include <jni.h>
#include "HelloWorld.h"
#include <stdio.h>
JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
printf("Hello world!\n");
return;
However when i compile this file i get the error that it cannot find the 'jni.h' and 'HelloWorld.h' files.
when i looked under the directory i can find the 'HelloWorld.h' file but i cannot find the 'jni.h' file.
so really i have 2 questions:
why cannot the compiler find the HelloWorld.h file
and where is jni.h located.
regards
Qasim

Create the HelloWorld.h :
1st. Write OK in HelloWorld.java then compiler to class.
2nd. use "javah - jni HelloWorld"
All the flow way is listed below:
1st. write HelloWorld.java
2nd. compiler HelloWorld.java to create HelloWorld.class
3rd. command: javah - jni HelloWorld to make HelloWorld.h
4th. write your C file
5th. Be sure to include "jni.h","HelloWorld.h"
6th. use VC++ ( or others.) to make out DLL file.
the 6th way like this:
C:\Program Files\Visual Studio\vc\bin\cl.exe -Ic:\jdk\include -I c:\jdk\include\win32 -LD HelloWorld -FeHelloWorld.dll

Similar Messages

  • JNI - How to use the error reporting mechanism?

    I've developed a C++ DLL which is loaded from a commercial Win32 application (not written by me) as a plug-in for external calculations. On its initialization the C++ DLL launches the Java VM via the JNI invocation interface. When the DLL functions are called by the application, they forward the calls to Java objects inside the Java VM, again via JNI invocation interface.
    This works well, but I have encountered a weird error.
    From Java I open a JFrame containing a JTextArea as small console for debug output messages. If I turn output to this debug console off (my printToConsole routine checks whether a boolean flag is set), the string concatenation operator may lead to a crash of the Java VM.
    For example, if in one of the Java functions called from the
    DLL via JNI invocation interface the following is the first statement,
    it leads to a crash of the Java VM and the application that loaded the C++ proxy DLL.
    String test=""+Math.random(); // String test not used later
    Interestingly, if I comment this statement out, the Java code works fine WITHOUT any crash. I've already thought about potential races and synchronization issues in my code, but I don't see where this is the case. And the string concatenation error fails as well, if I insert sleep() statements in front of it and at other places in the code. However, if I turn on log messages printed to my JFrame debug console (containing a JTextArea), the String concatenation works without problems.
    So maybe the JNI interface has a bug and affects the Java VM; I don't see where my JNI code is wrong.
    One problem is that I do not get any stdout output, as the C++ proxy DLL is loaded by the Windows application, even if I start the Windows application from the DOS command line (under Windows).
    Does anyone know how to use the error reporting mechanism?
    http://java.sun.com/j2se/1.4.2/docs/guide/vm/error-handling.html
    Is it possible that the JVM, when it crashes, writes debug information about the crash into a file instead of stdout/stderr?
    My C++ proxy DLL was compiled in debug mode, but the commercial application (which loaded the DLL) is very likely not.
    I do not know hot to find the reason why the String concatenation fails inside the Java function called from the C++ DLL via JNI.

    Yes, I've initially thought about errors in the C++ code too. But the C++ code is actually very simple and short. It doesn't allocate anything on the C++ side. It allocates a couple of ByteBuffers inside the Java VM however via JNI invocation interface calls of env->NewDirectByteBuffer(). The native memory regions accessed via the ByteBuffers are allocated not by my own C++ code, but by the program that calls my DLL (the program is Metastock).
    The interesting thing is that everything works fine if output to my debug console is enabled, which means that in the Java print routine getConsoleLoggingState() returns true and text is appended to the jTextArea.
    static synchronized void print(String str)
    { MetaStockMonitor mMon=getInstance();
    if ( mMon.getFileLoggingState() && mMon.logFileWriter!=null) {
    mMon.logFileWriter.print(str);
    mMon.logFileWriter.flush();
    if ( mMon.getConsoleLoggingState() ) {
    mMon.jTextArea1.append(str);
    Only if output to the JTextArea is turned off (ie. getConsoleLoggingState()==false), the crash happens when the FIRST statement in the Java routine called via JNI invocation interface is a (useless) String concatenation operation, as described above.
    String test=""+Math.random(); // String test not used later
    Moreover, the crash happens BEFORE the allocated ByteBuffer objects are accessed in the Java code. But again, if console output is turned on, it works stable. If console output is turned off, it works when the (useless) String concatenation operation is removed in the Java routine called from C++.
    I've already thought about potential races (regarding multiple threads), but this can be ruled out in my case. It almost appears as if the JVM can have problems when called by the invocation interface (I tested it with Java 1.4.2 b28).
    All the calls between C++ and Java go ALWAYS in the direction from C++ code to Java. Unfortunately, there is no special JRE version with extensive logging capabilities to facilitate debugging. And the problem is not easily reproducible either.
    JNIEnv* JNI_GetEnv()
    JNIEnv *env;
    cached_jvm->AttachCurrentThread((void**)&env,NULL);
    fprintf(logfile,"env=%i\n",env);
    fflush(logfile);
    return env;
    // function called by Metastock's MSX plug-in interface
    BOOL __stdcall createIndEngine (const MSXDataRec *a_psDataRec,
    const MSXDataInfoRecArgsArray *a_psDataInfoArgs,
    const MSXNumericArgsArray *a_psNumericArgs,
    const MSXStringArgsArray *a_psStringArgs,
    const MSXCustomArgsArray *a_psCustomArgs,
    MSXResultRec *a_psResultRec)
    a_psResultRec->psResultArray->iFirstValid=0;
    a_psResultRec->psResultArray->iLastValid=-1;
    jthrowable ex;
    jmethodID mid;
    JNIEnv* env=JNI_GetEnv();
    jobject chart=getChart(env, a_psDataRec);
    if ( chart==NULL) {
    return MSX_ERROR;
    jobject getChart (JNIEnv* env, const MSXDataRec *a_psDataRec)
    jthrowable ex;
    jmethodID mid;
    int closeFirstValid, closeLastValid;
    closeFirstValid=a_psDataRec->sClose.iFirstValid;
    closeLastValid=a_psDataRec->sClose.iLastValid;
    long firstDate, firstTime;
    if (closeFirstValid>=1 && closeFirstValid<=closeLastValid) {
    firstDate = a_psDataRec->psDate[closeFirstValid].lDate;
    firstTime = a_psDataRec->psDate[closeFirstValid].lTime;
    } else {
    firstDate=0;
    firstTime=0;
    jclass chartFactoryClass = env->FindClass("wschwendt/metastock/msx/ChartFactory");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find class ChartFactory\n");
    printSBufViaJava(sbuf);
    return NULL;
    mid = env->GetStaticMethodID(chartFactoryClass, "getInstance", "()Lwschwendt/metastock/msx/ChartFactory;");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find method ID for ChartFactory.getInstance()\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject chartFactory=env->CallStaticObjectMethod(chartFactoryClass, mid);
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Exception while calling ChartFactory.getInstance()");
    printSBufViaJava(sbuf);
    return NULL;
    mid = env->GetMethodID(chartFactoryClass, "getChartID", "(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IIIIIII)F");
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot find method ID for ChartFactory.getChartID()\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject symbolBuf=env->NewDirectByteBuffer(a_psDataRec->pszSymbol, strlen(a_psDataRec->pszSymbol) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate symbolBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityNameBuf=env->NewDirectByteBuffer(a_psDataRec->pszSecurityName, strlen(a_psDataRec->pszSecurityName) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate securityNameBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityPathBuf=env->NewDirectByteBuffer(a_psDataRec->pszSecurityPath, strlen(a_psDataRec->pszSecurityPath) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate securityPathBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    jobject securityOnlineSourceBuf=env->NewDirectByteBuffer(a_psDataRec->pszOnlineSource, strlen(a_psDataRec->pszOnlineSource) );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Cannot allocate onlineSourceBuf\n");
    printSBufViaJava(sbuf);
    return NULL;
    // Java Function call leads to crash, if console output is turned off and
    // the first statement in the Java routine is a (useless) string concatenation.
    // Otherwise it works stable.
    jfloat chartID=env->CallFloatMethod(chartFactory, mid, securityNameBuf, symbolBuf,
    securityPathBuf, securityOnlineSourceBuf, (jint)(a_psDataRec->iPeriod),
    (jint)(a_psDataRec->iInterval), (jint)(a_psDataRec->iStartTime),
    (jint)(a_psDataRec->iEndTime), (jint)(a_psDataRec->iSymbolType),
    (jint)firstDate, (jint)firstTime );
    if (ex= env->ExceptionOccurred() ) {
    env->ExceptionDescribe();
    env->ExceptionClear();
    sprintf(sbuf, "DLL: Exception while calling ChartFactory.getChartID()");
    printSBufViaJava(sbuf);
    return NULL;

  • 1.3 JNI libraries compatible with 1.4?

    I'm having some problems migrating my software from J2SE 1.3 to 1.4 (on Linux).
    I've not recompiled anything, hoping for Sun's binary code compatibility...
    Strangely enough, the first time I executed my program with the 1.4 VM,
    everything worked just fine. The same program had been running in the 1.3 VM just before that.
    But after rebooting the machine I encountered the first problem - the java program could
    not find my JNI libraries anymore, generating a UnresolvedLinkError.
    *Why did my 1.3- but not the 1.4-environment find the JNI ?
    Before, I didn't need the LD_LIBRARY_PATH variable, but now I used it and set it to the directory where the JNI libs are. This solved the UnresolvedLinkError problem - fine!
    BUT, when I now start up my program it takes about 2 minutes to get it up and after that it works
    real slow....
    Running with the -verbose flag I see that it hangs for a long while after loading the PlainSocketImpl
    <snip>
    [Loaded java.util.Vector$1 from /usr/j2re1.4.0/lib/rt.jar]
    [Loaded java.net.Socket from /usr/j2re1.4.0/lib/rt.jar]
    [Loaded java.net.ServerSocket from /usr/j2re1.4.0/lib/rt.jar]
    [Loaded java.net.SocketOptions from /usr/j2re1.4.0/lib/rt.jar]
    [Loaded java.net.SocketImpl from /usr/j2re1.4.0/lib/rt.jar]
    [Loaded java.net.PlainSocketImpl from /usr/j2re1.4.0/lib/rt.jar]
    *Why is it hanging after that line?
    *Is it necessary for me to recompile my JNI libs?
    *Why is it working so slowly?
    Please help me out!
    Regards
    / Lelle

    I just wanted to tell you that now I've recompiled my Java files but the program still
    stalls on start-up as before.
    I've not yet recompiled the JNI files, although I can't see why that should be needed.
    My command line looks as follows:
    /usr/j2re1.4.0/bin/java -server -verbose -verbose:jni -classpath /usr/Shared.jar:/usr/Server.jar ServerClass 123 JNIlib1 JNIlib2 JNIlib3 JNIlib4
    (123 is the port number for the server to listen to.)
    Something fishy is obviously happening during or after loading java.net.PlainSocketImpl
    <snip>
    [Loaded java.net.SocketImpl from /usr/j2re1.4.0/lib/rt.jar]
    [Loaded java.net.PlainSocketImpl from /usr/j2re1.4.0/lib/rt.jar]
    [Dynamic-linking native method java.net.PlainSocketImpl.initProto ... JNI]
    Any ideas anyone?
    / Lelle

  • JNI & iPlanet App Server

    I have a problem using JNI within iPlanet Application Server. I am told it does not support JNI (there is a problem
    loading library). Our platform is Solaris. Currently I am running RMI server to talk to JNI and then return data to my application. It works, but because I am passing huge amount of data I am concerned about performance. I know there is a way to doit for Web Server. Does anybody know about something for Application Server , how to load library within it ?
    Ela

    Is the LD_LIBRARY_PATH in the start script also set to include where your jni libraries are?

  • Cannot open include file: 'jni.h'

    Hiya just a quick question, I have been trying with no avail, to compile my c++ program with the path in visual express cmd, I have tried diff ways but still shows errors.
    The following is the code that I am using
    cl -I"c:\program files\java\jdk1.6.0_06\include" -I"c:\program files\java\jdk1.6.0_06\include\win32" -I"." -MT -LD HelloWorld.cpp -FeHelloDLL.dll
    where my path is C:\Program Files\Java\jdk1.6.0_06\include
    Thanks

    The -I options tell the compiler where to find the include files. You need to add a -I option that indicates where your jni.h file is located.This is normally the sub-directory 'include' relative to your JDK installation directory. Now you seem to have done this but you must double check all the paths.
    You would do well to spend some time looking at your compiler options because this will not be your last compilation problem.

  • JNI header files and /include

    Does anyone know where the JNI classes and what .jar file if need be or just what classes jni.c header file(s)are dependant upon, and do they reside in JRE 1.3.0 or 1.3.1, or do I need the JDK version to obtain these, also isn't there suppose to be a JAVA_HOME/include directory where JNI stuff is or at all, or did that all change in 1.3 and up. I thought I remember there being one 1.17 and 1.2ish JDK's if not JRE installs. Any help would be greatly appreciated. Thanks. Trask.

    and what jar are they in or what is the path to them from JAVA_HOME

  • JNI with WLS

    Hi,
    I need to use JNI code from a servlet in WLS. Everytime I
    invoke the servlet,the dll (where the JNI function resides) gets
    loaded, but I get an error java.lang.UnsatisfiedLinkError with
    the function name.
    The servlet belongs to a package. So, I have JNI function
    prototype declared with Package name included. I checked the
    PATH, CLASSPATH variables. All are set properly.
    What else am I missing here ?
    Any help is appreciated.
    Krishnan.S

    hai, 1. If u have used package name in the java class file which invokes the C function using JNI, then while creating the jni header file, u have to include the package name also. javah -jni packagename.classnameafter getting the .so file, make sure that, the path of that .so is given in the weblogic LD_LIBRARY_PATH (UNIX). see the startWebLogic.sh file (UNIX)seenu

  • JNI where to put the jnilib?

    I have a smal calculating code, and need it fast done, therefore I will use the JNI.
    On MacOSX there is no problem doing this with a dylib, compile the dylib, compile the jnilib put them in the Bundle .. ready to deploy. Easyly done.
    On WIN I get a messsage of unknownsource in the ClassLoader., Runtime. and System. loadlibrary(blah)
    Where do I have to put the blah.jnilib and the dll to get the applikation used of them??
    Must the library path set to get the compiled jnilib run on WIN?? Where do i have to set the path for the jnilib and the dll? DLL in system 32 I guess but where the jnilib???
    Or should i just name the prefix of blah when compiling .dll instead of .jnilib, but then I need to manage the file using on different platforms isn�t so??
    thanks for help

    Windows will find the DLL if it is listed in the PATH environment variable. On Windows XP, I click Start / Control Panel / System / Advanced / Environment Variables. I can then edit the path string which is a semicolon-separated path list.
    If you do not want to mess around with the environment variables, you can allways do it M$-style and squeeze the DLL into c:\windows\system32 amongst the other couple hundreds of DLL's already there.

  • Can anyone tell me where I got wrong in my jni conde?

    I am new to jni.
    I want to pass a class from java to C, and after some data value inserting, this class will be returned to Java.
    But the exception occured: java.lang.UnsatisfiedLinkError.
    I can't see where the error is.
    So anyone can give me any suggestions??
    I'll paste my test code as follows:
    TestSCJNI.java
    import java.lang.*;
    public class TestSCJNI {
              static {
              System.loadLibrary("TestSCJNI");
         private native ServiceComp test_queryServiceComp(ServiceComp _sc);
         ServiceComp sc;
         public TestSCJNI(){
              sc = new ServiceComp();
         public static void main(String[] args) {
              TestSCJNI t = new TestSCJNI();
              t.sc = t.test_queryServiceComp(t.sc);
              System.out.println("tsId" + t.sc.tsId + "NwID" + t.sc.orginNwId);
         class ServiceComp {
              char tsId;
              char orginNwId;
              char svId;
    }TestSCJNI.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <jni.h>
    #include "TestSCJNI.h"
    JNIEXPORT jclass JNICALL Java_TestSCJNI_test_queryServiceComp(JNIEnv *env, jobject obj, jobject sc) {
         jclass t = (*env)->GetObjectClass(env,sc);
         (*env)->SetCharField(env,t,"tsId",12);
         (*env)->SetCharField(env,t,"orginNwId",0);
         (*env)->SetCharField(env,t,"svId",3);
         //t.orginNwId = 0;
         //t.svId = 3;
         return t;
    } Thanks for any help!

    yes. The procedure I run the program are :
    1. javac *.java
    javah -jni TestSCJNI
    2. gcc -c TestSCJNI.c
    3. gcc �shared -o libTestSCJNI.so TestSCJNI.o
    4. java -Djava.library.path=. TestSCJNI
    I supposed that the procedure is right...
    Or something incorrect in the procedure??This is just a wild guess, but what happens if you replace step
    2) and 3) by one new step? like this:
    gcc TestSCJNI.c -o libTestSCJNI.so -shared -I<include stuff here>
    I suspect that gcc generates position dependent code if it just has
    to compile a compilation unit. The -shared flag implies the -fPIC
    flag for compilation if I'm not mistaken ...
    kind regards,
    Jos

  • Where can i download ACR120U.jar for acs.jni.* package?

    Hi Friends..
    Sorry before perhaps this question is a little bit silly, but i didn't found link/website where i can download ACR120U.jar for acs.jni.* package..
    Do you know where i can download it?..
    Thanks in advance..

    Hi,
    I've just installed 10g DB Release 2 (for Linux)
    and now I want to explore the Decision Trees feature
    of Data Mining (as in the presentation of Robert A.
    Habertroh in OTN). However when I use Data Miner
    connect to this new DB, it said "Cannot connect to
    ODM server". There is no directory odm under my
    $ORACLE_HOME.
    BTW: I download the from odmapi.jar
    http://www.oracle.com/technology/products/bi/odm/odmi
    ner.html, but now it said there is odmapi.jar for
    10.1.0.4.0 only. If I use this Data Miner to 10gR1 is
    OK.Hi Mark,
    Thanks for the promptly reply.
    I want to test the new features of ODM 10.2 as a "proof-of-concept" project. So could you inform when this will be available in OTN ?
    Thx

  • Where do we find best tutorials for JNI

    hi every one
    i am new to JNI and i want to know where do we can get best examples on JNI.

    See this links:
    http://www.servertec.com/products/jenie/docs/stec/jenie/Dll.html
    http://www.servertec.com/products/jenie/docs/stec/jenie/Function.html
    Here are 2 sample codes:
    1. have a c DLL (MyDll) stdcall fnc as follows.
    stdcall int MyFnc(int FileNo, int IOType, unsigned char * DataToWrite, unsig
    ned char * DataRead);
    class X {
    private native int MyFunc(int fileNo, int IOType, byte[] DataToWrite, byte[]
    DataRead);
    public static void main(String args[]) {
    X p = new X();
    byte[] c= new byte[512];
    byte[] c2= new byte[512];
    int result = p.MyFunc(1,0,c,c2);
    System.out.println(result);
    static {
    System.loadLibrary("MyDll");
    2. public class DLLBridge
    public DLLBridge() {
    public native void RprtMain();
    static{
    System.loadLibrary("Reports");
    public static void main(String[] args) {
    DLLBridge dbridge = new DLLBridge();
    dbridge.RprtMain();
    That is the signature of the C function that you need to write in order to
    implement the RprtMain() method that you declared as "native" in your Java DLLBridge class. Assuming you have an existing function in a DLL that you are trying to call, you will typically just write this function to call the other function. If the other function has parameters, you will
    typically use JNI functions to get the parameter values and massage them into the form required by that existing function, and do the reverse with the function result.
    Of course, there is no requirement that your native method call
    pre-written C functions. You can implement your native method any way you want to.
    I have not tested the code, just wrote down. Hope this will help you.

  • Where to find jni registry package?

    http://www.trustice.com/java/jnireg/index.shtml has broken links. I found some stuff elsewhere on the web, but I need the ICE_JNIRegistry.dll
    TIA

    [This site|http://www.google.com/search?q=ICE_JNIRegistry.dll] might have some info.

  • JNI and Tomcat

    I am trying to use a JNI library on Tomcat. I have created a class with a JNI API. I have tested its use being calling it from a Java application. It works. When I try to invoke it from my app server (Tomcat), I get a java.lang.UnsatisfiedLinkError exception. I must find a way to specify where the library is located, but haven't found how to do this. I have tried to add a -Djava.library.path=... option in the JAVAOPT environment variable in the shell where I run the catalina.sh script, but this didn't help.
    Any advice?

    If you are using tomcat over UNIX, you shold put the LD_LIBRARY_PATH pointing the path of your native library.

  • Problem with JNI for target armlinux

    Dear friends,
    We have compiled CVM for ARM Linux and it is working fine for java programs as well as C programs.
    But when I try to make shared library out of a sample hello world JNI program for arm linux it says 'jni.h: No such file or directory' and after that many lines 'syntax error' and 'parse error' etc.
    But the same program is running fine on x86 linux. Problem only while cross compiling for arm linux. It is not problem with arm-v5t-le-gcc because that is working fine. Problem is with what I need to include in makefiles.
    As I am new to this domain could anyone help me where I am missing?
    Regards
    Kishore

    I'm not exactly sure what you're talking about, but it sounds like you may need to look into global references. Look at NewGlobalRef() and DeleteGlobalRef() and see if those help you out.
    God bless,
    -Toby Reyelts
    For all your JNI woes, check out Jace - http://jace.reyelts.com/jace

  • Problem with JNI form C++

    Hi all,
    I'm fairly new to programming with JNI, so please excuse me if I ask a dumb question.
    I'm trying to call a Java method from a C++ class, but when I run the program, it throws an error, crashing the program. I'm pretty sure the problem is that the call to env->getMethodID() is throwing an error. I have looked around to try and find a way call a function with no arguments, but all of the examples that I have found all call a Java main.
    I'll post my code and the error message below so that things are a bit clearer.
    Thanks,
    Robert.
    Here is the main.cpp. This is where the program is started.
    #include "/usr/lib/jvm/java-6-sun-1.6.0.06/include/jni.h"
    int main()
       JNIEnv *env;
       JavaVM *jvm;
       jint res;
       jclass cls;
       jmethodID mid;
       // creation of the JVM
       JavaVMInitArgs vm_args;
       JavaVMOption options[1];
       options[0].optionString = "-Djava.class.path= .";
       vm_args.version = 0x00010002;
       vm_args.options = options;
       vm_args.nOptions = 1;
       vm_args.ignoreUnrecognized = JNI_TRUE;
       res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
       // now the rest of the code can work
       cls = env->FindClass("Test");
       mid = env->GetMethodID(cls, "run", "()V");
       env->CallVoidMethod(cls, mid);
       jvm->DestroyJavaVM();
    }Here is Test.java
    public class Test
       public void run()
          System.out.println("stuff");
          foo();
       public void foo()
          System.out.println("asdfasdf");
    }And here is the error message.
    # An unexpected error has been detected by Java Runtime Environment:
    #  SIGSEGV (0xb) at pc=0x06245f7d, pid=9054, tid=1076641792
    # Java VM: Java HotSpot(TM) Client VM (10.0-b22 mixed mode, sharing linux-x86)
    # Problematic frame:
    # V  [libjvm.so+0x245f7d]
    # An error report file with more information is saved as:
    # /media/MY STICK/jni/cpp/hs_err_pid9054.log
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    AbortedEdited by: metaldrummer610 on Apr 23, 2008 8:35 PM

    Yeah, so I just figured out what was wrong. I wasn't calling main from in Java. My bad guys.

Maybe you are looking for

  • Interactive VS. Classic Report

    Hi all, I have created both interactive report and classic report on the same table just for testing. http://apex.oracle.com/pls/apex/f?p=53917:1 You can see that the interactive report has link to single row view. How can I make my classic report to

  • New mac set up problems with time machine

    Bought a new 21 inch mac yesterday and going through set up I tried to use my time machine disk at the appropriate point  (when it asked me) to copy the data. Now the mac refuses to move on, after it rebooted I get the apple sign and the swirling thi

  • Allowing user to create link to a network file

    Is there a way to allow the user of a form to enter the path to a local network file (such as a Word document), so that when others click it, it will take them to the file? In a thread in another forum, someone posted the following method of create a

  • HT2905 iphone music library is mixed up....normal in itunes

    my music is all messed up, some songs show two...one will play and one wont...and when it does play its the wrong song.  Can anyone help?

  • JSP to get the JVM

    Hi, I'm rather new to JSP / java in general. wondering if some of the experts could tell me how i could get the JVM I'm running on (JVM ID or name) from a JSP. Thanks in advance for your time and efforts.