Using java jni

Hello,
I'm trying to figure out a way to start small Java-Programs from within
Labview 6.0.1. Does anybody know how to do this? Every time I use the
call dll-function to invoke the java-jni api Labview crashes. Invoking
Java via the active-x plugin doesn't work either.
Any suggestions are welcome. Thanks.
Norman Südekum

Norman,
Try updating to LabVIEW 6.0.2 to get all of the ActiveX fixes and try the ActiveX method again. (You cannot do this if you only have the Evaluation version.) You can also call java from the System Exec.vi if you do not need data directly back (you can transfer it many other ways: files, TCP, pipes, etc).
Also, see the following:
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=506500000008000000102D0000&ECategory=LabVIEW.LabVIEW+General
http://digital.ni.com/public.nsf/websearch/BEE812007BA2A9B486256BC80068A49A?OpenDocument
Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask

Similar Messages

  • How to open MSWORD using JAVA/JNI and write the database entries into WORD

    Hi..
    I am searching for java codes that uses JAVA NATIVE INTERFACE (JNI) for opening MSWORD 2003.
    To be brief.
    I created HTML form called Employee_data.
    if i click on Submit button a word document should be opened.This should be using JNI.
    I have also created a servlet in jsp to process the form data and store it into database(mysql).;
    Please help me to find the codes to open MSWORD on submit click and to write the database entries into word file.Can i get the full code for that.This is so urgent.
    Thanks in advance.

    Hi Suresh,
    The easest solution I can think of is to copy the math equation from the PowerPoint then paste in the Word document directly, there's actually no way to convert it to plain text, some equation is very complext, String variable is not suitable in this case.
    For example, this code works fine:
    var powerPoint = new Application { WindowState = PpWindowState.ppWindowMinimized };
    var oPresSet = powerPoint.Presentations;
    Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(@"C:\test.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
    var strObj = oPres.Slides[1].NotesPage.Shapes[2].TextFrame2.TextRange.MathZones.get_MathZones();
    strObj.Copy();
    Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
    wordApp.Visible = true;
    Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Add();
    doc.Range(0, 0).Paste();
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Authenticate against windows 2000 server securtiy using Java.JNI

    How could you use Java or JNI to read the password and group membeship from the operating system for a given windows 2000 user, from a servlet/class?

    Are you looking to build some sort of single sign-on module? You wouldn't be able to get the password, but you might be able to pass a token indicating the users credentials. You'd have to delve into the MSDN resources to get that.
    Once you figure out how to what you want using COM, you can more easily integrate it into Java using the sourceforge projects Jacob or JAWIN.

  • JNI - how to use java access function in TypeLibrary( .tlb file) HELP ME PL

    Hey All
    I got one project which can be done by calling up functions in xxxx.tlb
    (window type library) file, that is no problem.
    How to use java to access those functions???
    I know there are some classes which can be used to access function in
    DLL file e.g. JAWIN.
    Is the .tlb file related to one DLL file??? if so, how to locate the
    DLL file through .tlb file???
    Thanks a lot.
    Steve

    Use JNI to create a link between Java class and a DLL, then you can load that DLL (or TLB) from that class.
    Read the JNI Tutorials.

  • If I use "JSP - Java - JNI" ??

    When the Java -> JNI -> C is writen and tested OK.
    How can I use JSP to import the Class into JSP page???
    I tried. But failure.
    Have someone show a sample?? help~ Q_Q

    Thanks you again... ^_^ to help
    All My step and files are shown below:
    --[1 step]--------[ JSP file ]--------------------------
    <jsp:useBean id="myBean" scope="page" class="Counter"/>
    <jsp:getProperty name="myBean" property="count"/>
    --[2 step]---------[ write JavaBean ]-----------------
    public class Counter{
    public Counter(){}
    public native String printt(); // It's Native entry
    public static void main(String[] args){ // This just for Java in DOS runable.
    new Counter().printt();
    public String getCount(){
    return(new Counter().printt());
    @@@@@@@@@@@@@@@@ <= the server will call getCount() method, which the DLL's create the printt() method.it may cause the 1st errors because can't find printt().I guess.
    public void setCount(int newCount){}
    static{
    System.loadLibrary("HelloWorld"); //LOAD the DLL's from C create
    ---[3 step]------ [ Create Counter.h ] -- CMD:[ javah - jni Counter ]---------
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class Counter */
    #ifndef IncludedCounter
    #define IncludedCounter
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: Counter
    * Method: printt
    * Signature: ()Ljava/lang/String;
    JNIEXPORT jstring JNICALL Java_Counter_printt
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    ----[4 step]--- [Write HelloWorld.c ]-------------
    #include <jni.h>
    #include <stdio.h>
    #include "Counter.h"
    JNIEXPORT jstring JNICALL
    Java_Counter_printt(JNIEnv *env,jobject this){
    printf("Hello World!\n hihihi success!");
    return;
    ---[5 step]-- [use VC++ 5 to create the DLL from HelloWorld.c ]
    ---[6 step] ----- The result that Server says -------
    500 Internal Server Error
    java.lang.NoClassDefFoundError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:195)
    ...

  • How to use java programe in oracle form

    Hello Expert,
    My Config is : -
    Forms [32 Bit] Version 11.1.1.3.0 (Production)
    Jdeveloper - 10.1.3
    I want to use the java programe in form builder. I create the one java class in Jdeveloper -
    package demo;
    import java.net.InetAddress;
    import java.net.NetworkInterface;
    import java.net.SocketException;
    import java.net.UnknownHostException;
    public class get_info{
       public static void main(String[] args){
       ch_add();
       public static void ch_add()
      InetAddress ip;
      try { 
      ip = InetAddress.getLocalHost();
      /*System.out.println("Current IP address : " + ip.getHostAddress());  */
      NetworkInterface network = NetworkInterface.getByInetAddress(ip);
      byte[] mac = network.getHardwareAddress();
      /*System.out.print("Current MAC address : ");   */
      StringBuilder sb = new StringBuilder();            
      for (int i = 0; i < mac.length; i++)
      sb.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : ""));
      System.out.println(sb.toString()); 
      } catch (UnknownHostException e) {
      e.printStackTrace();
      } catch (SocketException e){
      e.printStackTrace();
    and this into Formweb.cfg and default.env and also add into Form_class_path. After that i import this java into forms.
    Code genertated -
    PACKAGE BODY get_info IS
      -- DO NOT EDIT THIS FILE - it is machine generated!
      args   JNI.ARGLIST;
      -- Constructor for signature ()V
      FUNCTION new RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN (JNI.NEW_OBJECT('demo/get_info', '()V', args));
      END;
      -- Method: main ([Ljava/lang/String;)V
      PROCEDURE main(
        a0    ORA_JAVA.JARRAY) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'main', '([Ljava/lang/String;)V', args);
      END;
      -- Method: ch_add ()V
      PROCEDURE ch_add IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'ch_add', '()V', args);
      END;
      -- Method: wait (J)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(J)V', args);
      END;
      -- Method: wait ()V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '()V', args);
      END;
      -- Method: wait (JI)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER,
        a1    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(2);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.ADD_INT_ARG(args, a1);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(JI)V', args);
      END;
      -- Method: equals (Ljava/lang/Object;)Z
      FUNCTION equals(
        obj   ORA_JAVA.JOBJECT,
        a0    ORA_JAVA.JOBJECT) RETURN BOOLEAN IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, 'java/lang/Object');
        RETURN JNI.CALL_BOOLEAN_METHOD(FALSE, obj, 'demo/get_info', 'equals', '(Ljava/lang/Object;)Z', args);
      END;
      -- Method: toString ()Ljava/lang/String;
      FUNCTION toString(
        obj   ORA_JAVA.JOBJECT) RETURN VARCHAR2 IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'demo/get_info', 'toString', '()Ljava/lang/String;', args);
      END;
      -- Method: hashCode ()I
      FUNCTION hashCode(
        obj   ORA_JAVA.JOBJECT) RETURN NUMBER IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_INT_METHOD(FALSE, obj, 'demo/get_info', 'hashCode', '()I', args);
      END;
      -- Method: getClass ()Ljava/lang/Class;
      FUNCTION getClass(
        obj   ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'demo/get_info', 'getClass', '()Ljava/lang/Class;', args);
      END;
      -- Method: notify ()V
      PROCEDURE notify(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notify', '()V', args);
      END;
      -- Method: notifyAll ()V
      PROCEDURE notifyAll(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notifyAll', '()V', args);
      END;
    BEGIN
      NULL;
    END;
    Now i want to call the o/p of Java programe in oracle text item. Please help me. It's very urgent. I am not good in Java.

    Sir i use java importer.
    PACKAGE BODY get_info IS
      -- DO NOT EDIT THIS FILE - it is machine generated!
      args   JNI.ARGLIST;
      -- Constructor for signature ()V
      FUNCTION new RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN (JNI.NEW_OBJECT('demo/get_info', '()V', args));
      END;
      -- Method: main ([Ljava/lang/String;)V
      PROCEDURE main(
        a0    ORA_JAVA.JARRAY) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, '[Ljava/lang/String;');
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'main', '([Ljava/lang/String;)V', args);
      END;
      -- Method: ch_add ()V
      PROCEDURE ch_add IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(TRUE, NULL, 'demo/get_info', 'ch_add', '()V', args);
      END;
      -- Method: wait (J)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(J)V', args);
      END;
      -- Method: wait ()V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '()V', args);
      END;
      -- Method: wait (JI)V
      PROCEDURE wait(
        obj   ORA_JAVA.JOBJECT,
        a0    NUMBER,
        a1    NUMBER) IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(2);
        JNI.ADD_LONG_ARG(args, a0);
        JNI.ADD_INT_ARG(args, a1);
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'wait', '(JI)V', args);
      END;
      -- Method: equals (Ljava/lang/Object;)Z
      FUNCTION equals(
        obj   ORA_JAVA.JOBJECT,
        a0    ORA_JAVA.JOBJECT) RETURN BOOLEAN IS
      BEGIN
        args := JNI.CREATE_ARG_LIST(1);
        JNI.ADD_OBJECT_ARG(args, a0, 'java/lang/Object');
        RETURN JNI.CALL_BOOLEAN_METHOD(FALSE, obj, 'demo/get_info', 'equals', '(Ljava/lang/Object;)Z', args);
      END;
      -- Method: toString ()Ljava/lang/String;
      FUNCTION toString(
        obj   ORA_JAVA.JOBJECT) RETURN VARCHAR2 IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'demo/get_info', 'toString', '()Ljava/lang/String;', args);
      END;
      -- Method: hashCode ()I
      FUNCTION hashCode(
        obj   ORA_JAVA.JOBJECT) RETURN NUMBER IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_INT_METHOD(FALSE, obj, 'demo/get_info', 'hashCode', '()I', args);
      END;
      -- Method: getClass ()Ljava/lang/Class;
      FUNCTION getClass(
        obj   ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
      BEGIN
        args := NULL;
        RETURN JNI.CALL_OBJECT_METHOD(FALSE, obj, 'demo/get_info', 'getClass', '()Ljava/lang/Class;', args);
      END;
      -- Method: notify ()V
      PROCEDURE notify(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notify', '()V', args);
      END;
      -- Method: notifyAll ()V
      PROCEDURE notifyAll(
        obj   ORA_JAVA.JOBJECT) IS
      BEGIN
        args := NULL;
        JNI.CALL_VOID_METHOD(FALSE, obj, 'demo/get_info', 'notifyAll', '()V', args);
      END;
    BEGIN
      NULL;
    END;
    I read both document which is given by you.
    Basicaly i don't know how to call java program in form builder.
    I wrote this code on When-button-pressed
    DECLARE
    jo ora_java.jobject;
    rv varchar2(1500);
    ex ora_java.jobject;
    BEGIN
    jo := get_info.new;
    rv:=get_info.ch_add(jo );
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
      message (' Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR );
      message('');
    WHEN ORA_JAVA.EXCEPTION_THROWN then
      ex := ORA_JAVA.LAST_EXCEPTION;
      message(' Unable to call out to Java ' ||Exception_.toString (ex ) );
      message(' Unable to call out to Java ' ||Exception_.toString (ex ) );
    END;
    No error comes and no output comes. I want the client MAC ID. please guide me where i need to change the code.

  • How to use java output with other application

    hi ,
    I am using acme.crypto to encrypt data. this is completely written in java. i need to pass input to this using VB6 and return the output to VB6
    how can i achieve the same, is there any readily available dll that can be used in vb?
    I am rigorously searching solution, which i am not finding.
    I need to know how should i place the java code so that it could be used with VB, as i am new to java world. Do i need to create component using java bean or how?
    The code i refered above is nothing but encryption algorithm. I need to pass the input string from vb to java, which will process me the output which inturn should be passed to vb6.
    Kindly guide me through this.

    Why not create a Java ServerSocket in your Java program.
    Connect the VB program to this ServerSocket.
    Send the input to the Java Program over this socket and have the Java Program encrypt the information and pass it back on the same socket.
    Don't know how hard Sockets are in VB6 but a Server Socket in Java is simple.
    No need for new DLLs, JNI, etc.

  • New "Windows Programming Using Java" Website

    Our newly created "Windows Programming Using Java" website (http://fivedots.coe.psu.ac.th/~ad/winJava/) is for programmers who want to extend Java's capabilities on Windows XP and/or Vista, but aren't sure where to start. One of the drawbacks of Java's portability is that many Java programmers have a rather sketchy knowledge of Windows-specific programming.
    We plan to explain how Java applications can utilize Windows application software, OS features, and hardware beyond the reach of Java's standard libraries. A variety of Java/Windows programming techniques will be explained, including:
    * Java's employment of the Win32 API via C, JNI, and J/Invoke.
    * Java's utilization of Window's Command Line Interface (CLI) and batch files, accessed through Java's Runtime, ProcessBuilder, and Process classes.
    * Java and Windows object-based scripting, centered around the use of VBScript, Windows Script Host (WSH), and Windows Management Instrumentation (WMI).
    * Java interoperability with COM, including hosting of ActiveX controls in Swing containers using jacoZoom.
    This website is a work in progress, with four chapters available for download at the moment. We'll be adding more regularly, and would love feedback on what we're doing.
    Thanks,
    Gayathri Singh and Andrew Davison
    [email protected] and [email protected]
    Edited by: AndrewDavison on Jun 20, 2008 1:36 AM

    Hi, I am looking the similar kind of requirement that you had done.. Do you have any more details on the code that is working for you . All i need is if the user logs in successfully in windows, the the app should be accessible. Please let me know if you have the code with you on this problem.
    Thanks in advance
    "what i meant is the we b applications running in my system, when i access the application iam able to to login automatically with windows authentication and now in case of other users following process happened:"

  • Use java code to start  ftp server in Windows

    I am writing an application using java to start the FTP server on Windows system Could anybody give me an idea on how to start?

    http://java.sun.com/docs/books/tutorial/
    http://java.sun.com/developer/onlineTraining/Programmin
    /BasicJava1/compile.html
    http://java.sun.com/learning/new2java/index.html
    http://javaalmanac.com
    http://www.jguru.com
    http://www.javaranch.com
    Bruce Eckel's
    Thinkin
    in Java
    Joshua Bloch's
    [url=http://www.amazon.co.uk/exec/obidos/Author=Bloch,%
    0Josh]Effective Java
    Bert Bates and Kathy Sierra's
    [url=http://www.amazon.com/exec/obidos/tg/detail/-/0596
    04656?v=glance]Head First Java
    lol. That's one way to start.
    But really, why would you want to start an ftp server from java?? You should use the right tool for whatever job you need to accomplish and you can set up windows to automatically start the server when it boots.
    majinda might say: it si lkie thrownig chickne at palm to knock datse to ground. bettre to let donkey kick tree.
    But if you insist, you'll probably need JNI.

  • ***How to use Java to change user password in *mdw file?

    Hi,
    Is it possible to use java to change user's password in the MS Access workgroup file(*mdw)? I have been searching for this topic for a long time, but no discoveries yet. Anyone has any idea?
    Sincerely,
    nonameisname

    There is probably a windows API call that does it.
    Once you find it, you wrap it in C code and then use JNI to call it from Java.

  • Calling Functions of Loading DLL using java

    I have a dll file
    I know the functions which are ther in the dll
    But how to call those functions using JAVA ?
    can anyone tell me how to do the same...
    Thanx in advance
    regards,
    Ritesh

    I assume that you have a regular DLL and that the functions in that DLL are exported and that you know the signatures of each function.
    With that in mind, you will need to use the Java Native Interface (JNI), to call those functions from Java. In a nutshell, you will need to create at least one class which declares some native methods, code a class static code block to load the JNI-DLL you are about to create, compile the class(es), run the javah tool supplied with the JDK which will emit a C compatible header file, implement the functions from the generated header file and compile that source file to into a DLL. It would be in this DLL that you would use the functions in the DLL that you ultimately want to access. So, what you wind up doing is creating a wrapper DLL.
    Take a look at the JNI tutorial trail from Sun at http://java.sun.com/docs/books/tutorial/native1.1/index.html.

  • "java.lang.UnsatisfiedLinkError" happen when I use java.exe in command line

    When I use Eclipse 3.01 to run the program it has any problem.But If I use the command line "java -classpath D:\Java_prj\Java\NativeMethod\out com.bruce.nativemethod.HelloNative",a error message will appear below:
    java.lang.UnsatisfiedLinkError: no ./out/com/bruce/nativemethod/ in java.library.path
         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403)
         at java.lang.Runtime.loadLibrary0(Runtime.java:788)
         at java.lang.System.loadLibrary(System.java:832)
         at com.bruce.nativemethod.HelloNative.<clinit>(HelloNative.java:21)My HelloNative.dll and HelloNative.class has all been putted in D:\Java_prj\Java\NativeMethod\out\com\bruce\nativemethod.
    My all source code is here:
    //HelloNative.java
    package com.bruce.nativemethod;
    import java.util.*;
    public class HelloNative{
         public static native void greeting();
         //Load the library
         static {
              System.loadLibrary("./out/com/bruce/nativemethod/HelloNative");
              //System.loadLibrary("HelloNative");
         public static void main(String args[]) {
              HelloNative.greeting();
    //HelloNative.c
    #include "HelloNative.h"
    #include <stdio.h>
    JNIEXPORT void JNICALL Java_com_bruce_nativemethod_HelloNative_greeting(JNIEnv* env,
        jclass cl)
        printf("Hello world!\n");
    //HelloNative.h
    //Generated by javah.exe
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class HelloNative */
    #ifndef _Included_HelloNative
    #define _Included_HelloNative
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     HelloNative
    * Method:    greeting
    * Signature: ()V
    JNIEXPORT void JNICALL Java_HelloNative_greeting
      (JNIEnv *, jclass);
    #ifdef __cplusplus
    #endif
    #endifI thinked the code is not problem.But why I can't not run it use java.exe tool in command line?

    Thanks everybody! My problem has been solved.The path "./out/com/bruce/nativemethod/HelloNative" is right because it can run in Eclipse 3.01.I don't agree use the absolute path.If do so,it may not use in another machine. The problem is when I use the "java -classpath D:\Java_prj\Java\NativeMethod com.bruce.nativemethod.HelloNative" in the command line windows,I have putted it the C:\ directory to excute.laterly,I putted the command in the D:\Java_prj\Java\NativeMethod,the result "Hello world!" is appear.

  • Accessing device registers and microcontroller registers using java

    We are writing an application that needs to work with any kind of microcontroller(more specifically targetted towards 8051 and 80188/86 microcontrollers) in a constrained memory environment with code/data not
    more than 128 KB or at the most 256 KB.
    We would look at using the JVM in hardware rather than software as an accelerator chip on our boards..
    However I wanted to know whether there is a way wherein I can accomplish the above platform independence for microcontroller and still access low level registers for the memory mapped I/O devices using Java..
    If anybody knows about this please let me know at
    [email protected]

    Not in pure Java, although you can do that in JNI. But if this is the main purpose of your program, you might as well use C++ or some more low-level language.

  • Is there any known issue about mutex lock used in JNI on Solaris 10?

    Dear Oracle,
    I'm facing a strange behavior when running a JNI application that use the mutex lock. The application hanged after running for a while on one of our Solaris 10 machines. After investigating the stack trace of the application, it shows that one of all the application's threads that access the JNI hold the mutex lock forever, and that cause the other threads cannot access the JNI. The same application works fine on other Solaris 10 machines.
    The mutex function I used as show below:
    mutex_lock(&mutex)
    The application hanged at this line:
    0xff2cc940 ___lwp_mutex_timedlock + 0x8
    The Kernel version is SunOS 5.10 Generic_142900-14
    Since this issue occurrs on only one Solaris 10 machine in our environment, we are wondering if there is any known issue regarding the mutex lock used in JNI on Solaris 10. We tried to search the Internet and the Java Bug database but found nothing related to this issue.
    Best regards,
    Krit K.

    876587 wrote:
    ... and that cause the other threads cannot access the JNI. The same application works fine on other Solaris 10 machines.
    Different environments mean just that. So something could be causing it outside java.
    Additionally if anything at all is different in the execution data, such as even a name having a different size, then it would change the execution path.
    Which would cause a problem in the JNI code to manifest itself on only one box. Probably isn't a pointer bug but all sorts of odd behavior can result from that.

  • How to create the groups in OID Using Java API.

    Hi,
    I need to create the group in OID Using Java API's only(i.e., javax.naming.* only).
    I need to achieve it without using any oracle specific jars.
    Is there any way to achieve it?.If there's a option to achieve it,do let me know.
    I also need to create the users in that group ,after creating it.
    If you share any useful link or ideas for the same would be great.
    Thanks
    Balaji

    bobws wrote:
    Hi,
    I want to find the installed JREs in windows using java. I couldn't fine any java API. So I am using the below code to fetch the JRE list from windows registries & parse the returned collection to know the installed JRE.Why? If you are running java you already have a JRE. So why not just use it?
    >
    String key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment";
    Runtime.getRuntime().exec(
    "reg query " + "\"" + key + "\"");
    Is it legal to retrieve the installed JREs in this way? Legal? It is OS specific, and to a certain extent dependent on vendor and what the vendor wants to do. Could also be impacted by permissions. Other than that it is ok.
    I am feeling like its a type of hacking. So I couldn't decide whether this is legal (recommended) way of using. Does anybody can answer me. I can see the similar posts in google. Somebody suggests this way & somebody suggests to use preference API which is similar to this. Appreciate your help.Preferences won't work. It doesn't allow access to the registry in general, only a part of it. There are discussions in the JNI forum about retrieving VM versions. Prior to actually using the VM though.

Maybe you are looking for