Java Application Calling C Library

I need to build a java app to call a C library. For the C library, all I have is some .lib, .dll and .h files. What should I do to achieve this goal to have my java app to call the methods in the C library? Please advise.

Also JNI

Similar Messages

  • How to create a java application & call it from a PDA via TELNET

    Dear All,
    My objective is to create a java application that's hosted on a server and called remotely from a PDA using TELNET.
    I've created a java application using Eclipse & the jCurses library. Unfortunately, the jCurses API events and listener aren't enough and i wasn't able to achieve my target application functionality.
    Can anyone advise a library other than jCurses that can help create a java application that can be called from a PDA via TELNET?
    Is AWT an option ?
    Thanks in advance for your support,
    Best regards,
    Lana

    user10827661 wrote:
    My objective is to create a java application that's hosted on a server and called remotely from a PDA using TELNET.
    I've created a java application using Eclipse & the jCurses library. Unfortunately, the jCurses API events and listener aren't enough and i wasn't able to achieve my target application functionality.
    Can anyone advise a library other than jCurses that can help create a java application that can be called from a PDA via TELNET?
    Is AWT an option ?Your server side Java application can use a Java library that
    creates a java.net.ServerSocket to listen for TCP connections from TELNET clients.
    You do not need any graphics (jCurses or AWT) on the server side, telnet is a simple ascii protocol.

  • How to call a AWT java application from TELNET ?

    Dear All,
    I've created a java Application using AWT, can anyone advise how it could be called using TELNET.
    Thanks in advance,
    Best regards,
    Lana

    Additionally, multi-posted to the Java Mobile sub-forum of this OTN site, as well.
    How to create a java application & call it from a PDA via TELNET
    Your impatience is your issue, not anyone else's.

  • Calling a running Java application

    I am writing a Windows DLL which is loaded by a Java application. Usually the Java application calls DLL functions. But at some point, I need to call some method in the Java application (a callback notification). Please let me know how can I do this. I appreciate sample code. Thanks in advance.
    -Harish

    Hi,
    You can do that with JNative.
    You can look a sample source at http://jnative.cvs.sourceforge.net/jnative/JNativeCpp/CallBack.cpp?view=markup
    Hope this will help you,
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Java application to call BOXI cluster report server

    Dear all,
    We have a BOXI 3.1 cluster consisting of 2 servers, says server1 and server2.
    Which server should the java application call to? server1 or server2? I don't realize there is BOXI cluster common hostname that can be resolved by DNS.
    If the application calls to server1, what if server1 is down?
    Many thanks

    For the Java version of the BusinessObjects Enterprise SDK starting with XI 3.x, CMS members and their "Name Server Port" are persisted by the SDK in the file %HOME%\.businessobjects\clusterinfo.1200.properties file.    This file is read when SessionMgr is instantiated.
    When logon method with a CMS member name/port is invoked, it's looked up to determine what cluster the member belongs to, as recorded in the properties file.  Then a random CMS member from that cluster is selected, and connection is attempted to that CMS Name Server.
    So regardless of what CMS name you enter for the logon, it should at least fail over to a live one.
    The only issue happens if there's no clusterinfo.1200.properties file (i.e., fresh install on the SDK machine) or not accessible (if the process has no rights to access that file).  Then you have to ensure the CMS name you enter is to a live one.    If it's a fresh install and there's sufficient file access, the initial contact with a live CMS Name Service will retrieve all CMS members, and the SDK will update teh properties file.
    So you shouldn't have to worry about which CMS name you specify.
    Sincerely,
    Ted Ueda

  • Java call C library?

    hi, please anyone know use java code call c library in dll format. can anyone show me the code. please.
    java code load C dll library?

    Java can call C++ DLLs using JNI:
    http://www-128.ibm.com/developerworks/edu/j-dw-javajni-i.html
    %

  • How to deal with java.io.EOFException error in Java application?

    Recently a java application called Jin stopped working on my iMac under 10.6.8. On startup it gives a java.io.EOFException error. When I boot from a full backup on external hard disk, the program still works fine. It has run without problem for at least two years.
    This program logs onto an online chess community called ICC (see chessclub.com) using a non-http protocol.
    I have tried everything I can think of to repair the problem, including:
    -- Reinstalling both Jin and Java
    -- Playing with Java Preferences, in particular trying both 32-bit and 64-bit versions
    -- Discarding a couple .plist files associated with Java and Jin
    -- Repairing permissions
    -- Replacing /usr/share/java/Tools with version from backup disk (I created a Smart Folder to find files recently changes, and these were the only java files that came up
    I've run out of ideas. It seems to me that some obscure Java support file has been corrupted, but I have no idea what or where.
    Is it a good idea to replace the entire /Library folder from backup, or is that going to cause a problem?
    I have a very bad feeling about replacing /System from backup.

    Please enable the following debug
    CA server
    /atg/epub/DeploymentServer
    loggingDebug=true
    /atg/deployment/DeploymentManager
    loggingDebug=true
    loggingThreadDebug=true
    Agent Servers
    /atg/epub/DeploymentAgent
    loggingDebug=true
    recreate and attach the full logs
    ++++
    Thanks
    Gareth
    Please mark any update as "Correct Answer" or "Helpful Answer" if that update helps/answers your question, so that others can identify the Correct/helpful update between many updates.

  • How can i launch another java application using Runtime class?

    I created a java process which invokes another java application called Launch as shown below,
    Process p=Runtime.getRuntime().exec("java -classpath=C:\\Program Files\\bin\\nettools\\ui\\updates Launch");
    But it is not working...can any one help me on this?
    Edited by: deepakchandaran on Sep 20, 2007 7:10 AM

    You could search the forum and Google.
    it has been answered before.
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Starting and stopping applications via a Java-application on Windows/Unix

    Hello,
    I want to start java and other applications via a java application.
    This java application should start several different applications on windows and
    on unix systems and take care of their current state (e.g. running/not running).
    For all applications to be started there are .sh-scripts for unix and .bat-scripts
    for windows. In the scripts there could be a java call, e.g. "java someApplication",
    or some executables could be called. These scripts set the applications' environment etc.
    and start the application finally.
    My java application calls these scripts via the ProcessBuilder API, which is working fine.
    But there is the following problem: on windows, when executing a script that starts
    some other application, the ProcessBuilder gives me process-handle to the started
    process. If calling destroy() on this handle, only the cmd.exe gets killed which
    started the application. The application itself is running on. This is undesired behaviour
    since I want to be able to control the started applications, at least start and stop it which
    is impossible that way.
    On unix, it is working when using
    "exec java someApplication"
    instead of just
    "java someApplication"
    in the .sh-scripts. The exec command substitutes the shell process with the underlying
    process started in the script, so everything is working as expected on unix.
    But how could I get this working on windows systems? Is there any equivalent to the exec
    command on unix? Any suggestions appreciated.
    If something's unclear in my description, please let me know.

    Yes - after looking at this option - I think that's the direction I am going to go. It probably makes sense to give my JMS topics and my BPEL server their own OC4J instances anyway - for a number of reasons.
    Lon

  • How to call function in included dll file through java application.

    Hi All,
    i am trying to create an java application which call c# functions using JNI. i am completed with the code and it is running fine when i tried to run from netbeans IDE. But when i tried from Calculator.jar file, first time it throws this error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no CSharpClient in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at calculator.CalculatorApp.<clinit>(CalculatorApp.java:20)
    After that i included that dll file in the cuurent directory. And compiled and tried to run, it throws an unexpected error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    *# An unexpected error has been detected by Java Runtime Environment:*
    *# Internal Error (0xe0434f4d), pid=2640, tid=3700*
    *# Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode, sharing)*
    *# Problematic frame:*
    *# C [kernel32.dll+0x12a5b]*
    *# An error report file with more information is saved as hs_err_pid2640.log*
    *# If you would like to submit a bug report, please visit:*
    *# http://java.sun.com/webapps/bugreport/crash.jsp*
    Anyone have idea how to solve this error.
    Thanks in advance.

    This error is created whenever things go sour on the native side. The first thing you can try, and I assume you are using a Java<->C++<->C# bridge which includes two dlls, one created by C++ and another by C#. Is to make sure that the C# dll is compiled using /t:module switch during compilation.
    If you are using VS2008, or VS2005, you can add a post build syntax like:
    csc /t:module /out:"$(ProjectDir)$(OutDir)YourModule.dll" "$(ProjectDir)YourCSfile.cs"
    Hope this helps! If not, ensure first that the native code works by creating a native test app for it.

  • Help with calling a java application from inside another one

    Hello!
    I am having this problem which is getting on my nerves and dont know how to solve..
    I want to call from my java application, another java application. So i use the exec command. Then i want to read the output of this execution from my own application, (the "parent" process).
    But it doesn work properly. Something seems to happen and i dont get the whole output.
    The java program i want to call is created for running an application created with Matlab java builder.
    This program works when called from cmd, but seems not to work when called from inside a java application.
    The code of my java application is:
    Runtime rt = Runtime.getRuntime();
    Process child;
    // The java class getmagic is a special kind of java file that uses classes that work in matlab. It uses a component (.jar) file that is created from matlab java builder. thats why it wants the -classpath and the rest options.
    //I hope you wont get messed up in here.
    String[] callAndArgs = {"java","-classpath",".;C:\\Program Files\\MATLAB\\R2006b\\toolbox\\javabuilder\\jar\\javabuilder.jar;..\\MagicDemoComp\\magicsquare\\distrib\\magicsquare.jar -Djava.library.path=C:\\Program Files\\MATLAB\\R2006b\\bin\\win32;","getmagic","4"};
    try{
    child = rt.exec(callAndArgs);
    InputStream is = child.getInputStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line;
    while ((line = br.readLine()) != null)
    System.out.println(line);
    is.close();
    System.out.println(child.waitFor());
    System.out.println("Finished");
    }catch(IOException e) {
    System.err.println("IOException starting process!");
    }catch(InterruptedException e) {
    System.err.println("InterruptedException starting process!");
    The java program (getmagic) thats uses matlab gives the following output (after some time) when called in cmd with argument 4
    Magic square of order 4
    16 2 3 13
    5 11 10 8
    9 7 6 12
    4 14 15 1
    My program shown above only prints:
    Magic square of order 4
    1
    Finished.
    Do i do something wrong? How can i get the rest of the output???
    Thank you very much in advance,
    Stacey
    PS: I am sorry for the length of my post.

    Hello CaptainMorgan08, thanx for the instant reply.
    I tried, but no, i cant.
    Because i cannot include this java aplication that uses matlab into my application, cause 1) it needs special arguments in the compiler and during execution so it can be run and 2) it uses classes that java doesnt have. only the java-like matlab code.
    For example it uses:
    import com.mathworks.toolbox.javabuilder.*;
    import magicsquare.*; //the component which is made from matlab java builder.
    So i cannot compile it with my application!
    If you know of a way, please let me know!
    I know i might be missing something.. something that is obvious to you.. but i ve been working days=nights hardly no sleep..so you can excuse me if i say something foolish..
    Message was edited by:
    Stacey_Gr

  • Can we call a webservice  using standalone java application  ?

    Hi friends,
                   Can we call configurd webservice in xi , using standalone java application by just giving url of webservice ?
                  OR
                  Only by means of WEBDynapro we can call  ?
                    Can you please tell me the answer for this .
    Regards .,
    V.Rangarajan

    HI Ranga Rajan
    well, If at all if you have webservice...you can import that werbserivce as External definition in to IR.
    How to import:
    1) Go to IR and and move to your requied component and there you can see the option called imported objects...select on imported objects where you can give the name and you can select the webservices which you want to use it.
    2) Hope you are aware of that a werbservice will have the request and response.
    3) Create the mapping program accroding to your requirement.
    Go through blogs of Bhavesh and Naveen which talks about calling webservice in a specific condition:
    Webservice Calls From a User Defined Function - /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    Consuming/Calling webservices from DataBases - /people/sap.user72/blog/2005/10/20/consumingcalling-webservices-from-databases
    Also check this help file on Web Services:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/336365d3-0401-0010-9884-a651295aeaa9
    Cheers..
    Vasu
    <i>** Reward Points if found useful **</i>

  • Example-- Call RFC from external Java Application

    Update: I need code example to call RFC from External Java application. Can onybody help me?                                                      
    RGDS
    RP
    hi all.
    i want to create my own log for each interface.
    i saw this blog:
    /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
    my doubt is how to catch the error that i see in SXI_MONITOR y put it in a Sub-Objetc.
    For example: in sxi_monitor i get the error for my interface NMUCustomer: "No receiver could not be found" or "Error Mapping Traformation".
    I created an Object called ZNMUCUSTOMER and a Sub-Objetc called ZERROR.
    what i must do to get the error I see in monitor and assign it to Sub-Object??
    Rgds.
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra

    Hi,
    Oh, you are using ABAP mapping ......
    then use the following in ABAP mapping ..
    TRACE1,TRACE2,TRACE3.... for trace level 1,2,3......
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/866ce290-0201-0010-338f-b8c3553aaa0f
    Regards
    Chilla

  • Multi-threaded java application and deadlock down in Oracle library

    Hello,
    I was running our Java (JDK 1.6_14) application from Windows XP hitting an Oracle (10g) instance on Linux and came across a deadlock issue with two (of 10) threads. Below is the stacktraces (based on Java thread-dump at the command line). This code I've run 30-40 times with no problems of deadlocks.
    The Oracle library that we're using for our Java application is ojdbc14.jar and sdoapi.jar (for spatial).
    We create our Connection as follows (for each thread -- 10 of them):
    public class Worker implements Runnable
    private Connection _Conn;
    public Worker(...)
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    _Conn = DriverManager.getConnection(url, username, password);
    _Conn.setAutoCommit(false);
    The code that is already executing these same lines below was already executed by other threads (in their own instance of Worker). So this is very confusing.
    Any ideas? Version of the .jar files? Place how we're calling "DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());"?
    Thanks, Jim
    Found one Java-level deadlock:
    =============================
    "WORKER_1":
    waiting to lock monitor 0x02b50d8c (object 0x22e8af80, a oracle.jdbc.driver.T4CConnection),
    which is held by "WORKER_0"
    "WORKER_0":
    waiting to lock monitor 0x02b50d24 (object 0x22f6d258, a oracle.sql.StructDescriptor),
    which is held by "WORKER_1"
    Java stack information for the threads listed above:
    ===================================================
    "WORKER_1":
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3410)
    - waiting to lock <0x22e8af80> (a oracle.jdbc.driver.T4CConnection)
    at oracle.sql.StructDescriptor.initMetaData1_9_0(StructDescriptor.java:1516)
    - locked <0x22f6d258> (a oracle.sql.StructDescriptor)
    - locked <0x22eabd80> (a oracle.jdbc.driver.T4CConnection)
    at oracle.sql.StructDescriptor.initMetaData1(StructDescriptor.java:1408)
    at oracle.sql.StructDescriptor.isInstantiable(StructDescriptor.java:892)
    at oracle.sql.STRUCT.<init>(STRUCT.java:148)
    at oracle.spatial.geometry.JGeometry.store(JGeometry.java:2954)
    at oracle.spatial.geometry.JGeometry.store(JGeometry.java:3777)
    .......... <our package/class>
    "WORKER_0":
    at oracle.sql.StructDescriptor.initMetaData1_9_0(StructDescriptor.java:1494)
    - waiting to lock <0x22f6d258> (a oracle.sql.StructDescriptor)
    - locked <0x22e8af80> (a oracle.jdbc.driver.T4CConnection)
    at oracle.sql.StructDescriptor.initMetaData1(StructDescriptor.java:1408)
    at oracle.sql.StructDescriptor.isInstantiable(StructDescriptor.java:892)
    at oracle.sql.STRUCT.<init>(STRUCT.java:148)
    at oracle.spatial.geometry.JGeometry.store(JGeometry.java:2954)
    at oracle.spatial.geometry.JGeometry.store(JGeometry.java:3777)
    ..........<our package/class>
    Edited by: Jim Atharris on Aug 24, 2009 6:23 PM

    Thanks Toon for your reply.
    Yes each Worker (executing in their own thread) has their own instance of Connection as per the Constructor (shown in original post). That is why this is weird.
    I'll check the v$session when I get into work.
    Based on our code that I put in the original email, Connection is a non-static variable. We have a per Thread per instance of Worker of which that Worker instance has its own instance of Connection. So I'm wonder if the following needs to occur:
    Both of these lines (from original email) need to happen in the main thread as follows:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    for (i=0;i<NUM_OF_WORKERS)
    _Conn = DriverManager.getConnection(url, username, password);
    new Worker(_Conn);
    Thanks,Jim

  • How can i call a jasper report from a java Application

    Hi,
    i am chiranjit , currently i working in a web based ERP project, in this project as a report building tool we are using JasperReport wih eclipse plugin . in eclipse report's are generating very well but i am unable to call that report from a java application because i have no idea about the How to call a Jasper Report from a Java Application . so please send me the necessary class names, jar files names and programe code as early as possible.
    Chiranjit

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Picking the value of PBEG and PEND incase of multiple entries 2002 on a day

    Hi Experts, Our client's business requirement is to have provision handling multiple entries multiple entries of same subtype of IT 2002 on same day with different Time entries.For example one IT 2002 Styp 1 has entry 10 am to 14 pm & other entry of

  • How can I apply a new style with a snippet and make DW remove artifacts of the old style?

    Hello, I am using Dreamweaver CS5 on Windows XP SP3. My problem seems simple but the resolution remains elusive. Let's say I am editing pasted-in text from MS Word that DW has auto-formatted. I highlight some text and use a snippet to enclose the tex

  • Is it possible to back up data if hard drive is crashing or has crashed

    My son's computer froze and I have tried to reboot while holding down the option key and by holding down Command + Option + R for an internet reboot. When I try to repair utilities from the internet, I cannot choose the hard drive; instead, my option

  • SWF file different from internal movie testing

    ok i made a basic website in flash when i test the movie while my file is open everything works fine, no errors pop up or anything, but when i go to drag the swf file into a web browser, random movie clips as well as all of my buttons are missing and

  • Wireless Presenter in Windows 8

    I have a Wireless Laser Presenter that works fine in every Windows version except for Windows 8. Multimedia and mouse functions do not work under this OS. However, the page up and down functions work, so it is not a connectivity problem. In the Windo