Is it possible to call a class in a jar file from JNI environment?

Hi
Is it possible to call a class in a jar file from JNI environment?
Thanks in advance.

Could you explain a bit more what you are trying to do? (In other words, your question is vague.)
o If your main program is written in C, you can use JNI to start a JVM, load classes from the jar of your choice, and call constructors and methods of the objects defined in the jar.
o If your main program is java, and has been laoded from a jar, a JNI routine can call back into java to use the constructors and methods of classes defined in the jar(s).

Similar Messages

  • How to Invoke a main class in a jar file from my project

    Hi
    I am a new user of the Sun Java Studio enterprise. I would like to know how i can invoke a main method in a jar file associated to the project.
    regards
    Nisanth

    Could you please clarify: do you want to run your project or a project from an independent jar?
    In the first case just select Run Project from the project context menu or select a class with main method and click Run File in the class context menu.
    Regarding the second case:
    - I don't think there is such a feature in the IDE (running third party jars is not an IDE function). Could you explain why you need this?

  • How to call the methods of JAR file into webDynpro Environment

    Hi All ,
             I have a requirement to call the methods of a JAR file into
             WebDynpro Environment. can anybody suggest me How this can be achieved. I Have a JAR file named FastTrack.API
    which contains few methods and i want these methods to be accessable into WebDynpro as other methods.
    Plz Somebody help me to sort this out.
    Regards,
    Deepak.

    Deepak,
    Please follow these 2 steps:
    1. Add jar into webdynpro project
            Right Click on ur project -> Select properties -> Java Buil path -> Choose Libraries Tab -> Add External Jars -> add the file from ur computer
    2. Use the jar
          write the import statement in your webdynpro code to utilize the properties of added jar.
    Thanks & Regards,
    Ram

  • Is it possible to call a class method using pattern in ABAP editor.

    Hi,
         Is it possible to call a class method using pattern in ABAP editor.
    Thank U for Ur time.
    Cheers,
    Sam

    Yes,
    Click patterns.
    Then choose Abap objects patterns.
    Click on the Tick
    It will give a new screen
    Here Give the name of the class first.
    Then the object (instance of the calss)
    And finally the method ..
    it will give you the pattern
    Hope this helps.

  • Is it possible to call custom designed RFC function module, apart from BAPI

    Hi Friends,
    1.     Is it possible to call custom designed RFC function module, apart from BAPI.
    2.     Why we call it Adaptive RFC layer, Since every time the JCO layer updated with SAP, Why can’t be dynamic.
    Thanx for Ur time.
    Cheers,
    Sam

    Also check <a href="http://help.sap.com/saphelp_nw04/helpdata/en/41/38bc8f813719488ddc9d9b21251ec3/frameset.htm">here</a> for more information on aRFC. Here you can find why it is called adaptive.
    Regards,
    Christophe

  • How to call a class that extends a frame from a panel ?

    How to call a class that extends a frame from a panel ?
    I am trying to create an application say "Videoshow"
    Videoshow has a panel which in turn consists of 2 components : 1]a textarea( to show the contents of a page) and 2] a mediaclip(to show the video).
    Now I have an application "MediaApplication"(to show the videoclip) which extends Frame (Code from Java 2 Unleashed, Chap 21). I want to show this MediaApplication in Component 2 of the above panel. But when I do this, I only see the MediaApplication frame instead of the whole SlideShow.
    I want to do something likethis.
    VideoShow :
    |---------------------------------|-------------------|
    | |
    | (Comp 1) | (Comp 2)
    | TEXTAREA | Video Clip
    | |(MediaApp entends Frame)
    |---------------------------------|-------------------|
    What is the best way to achieve this ? Also which component can I use to show the videoclip ?

    im not familiar with the code you mention from Java 2 Unleashed, but your best bet is to read up on Swing a bit - so you get an idea of how Swing containers and components work - then im sure you'll find a solution to your problems. Then if you encounter any difficulties whilst your attempting to do that, post your code in the Swing forum and im sure someone will help you.

  • How to call a jar file from oracle forms (6i)

    Hi,
    I'm working with oracle 6i. I want to know that how to call a .jar file from forms menu. when I use HOST('<path>\test.jar') it is working in 'Client Server' any way. but the problem is I use application server in order to run my form. so my form is in the server and I run the form via clients web browser. in that case above solution will not work. if any body knows how to overcome this problem please reply.
    thanks.
    duminda

    I created a bean area and set the class name as implementation class. within that java bean class I called to a bat file which consists of the execution command of the jar file ( because i don't know how to call .jar file from my bean class directly).
    then i tried to run it in application server. its still not running.
    can you tell me what i have to do within my bean class? or can you suggest any solution?
    thank you.

  • Access jar file from in-memory classes...

    I have some classes that I compile to memory and everything works fine until one class that must access some external jar files. I have been unable to access those jar files from disk after trying every suggestion using URLClassLoader. I even tried someone's example to hack the SystemClassLoader which properly adds the jar file paths, but still they can't be seen. The only way it works is if I put the files in the jdk/jre/lib/ext directory. Then everything works fine. There must be a way to load the jar files in memory as well as the class files so they can be accessible. Has anyone done anything like this? Is it possible? Even though the class files are in memory, why would the jar files not be seen even when they are added to the same URLClassLoader's URL's. Thanks.

    Sorry that wasn't clear. What I mean is that the classes are compiled to byte code directly to memory and no physical .class file is created. Yes, I'm using my own ClassLoader that extends URLClassLoader and I'm setting the parent to ClassLoader.getSystemClassLoader(). I also should mention that I'm doing this inside a Netbeans module that is part of a Netbeans Platform application. I don't know why that should matter though, since I'm trying to do everything in memory without creating the physical files. Thanks.

  • Main class in a Jar File

    Hi
    I have created a ja file containing my whole project.
    the jar file contains a java class which contains a main method.
    now i want to run this java class present in my jar file from the command prompt. is it possible to do it. can we run a java file which is inside the jar file.
    i don't want to extract the jar file to run the java class.
    Please let me know what needs to be done in this case.
    Thanks & Regards
    Vikeng

    now i want to run this java class present in my jar
    file from the command prompt. is it possible to do
    it. can we run a java file which is inside the jar
    file.
    java -jar MyJar.jarYou need to set the Main-Class attribute in the manifest, though.

  • Can I create a JTA EntityManagerFactory in a utility class in a .jar file?

    I have utility classes in a .jar file inside of a .war file deployed in Glassfish 3.1. One of these utility classes, CredentialsUtil, needs to access a database. I can't inject an EntityManager into CredentialsUtil since it is not an EJB. (For security reasons I don't want to make CredentialsUtil an EJB. I want it to be a POJO.)
    In CredentialsUtil I need an EntityManagerFactory that is connected to a datasource defined in Glassfish. Here is the line from CredentialsUtil.java and from the persistence.xml both of which will be in the util.jar file:
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("Credpu");
    <persistence-unit name="Credpu" transaction-type="JTA">
    I can't use RESOURCE_LOCAL since any changes to the datasource configuration must be done in Glassfish rather than changing persistence.xml.
    (The transaction context is not important in CredentialsUtil. It will be called by a WS-Security handler which may not have a transaction context.)
    Can I put the persistence.xml and the CredentialsUtil class that creates the EntityManagerFactory from it inside of the util.jar file (which will be in a .war), or do I have to move the class and a copy of the persistence.xml file out to the .war file? (I'll have to leave persistence.xml in the .jar file too since there are some @Entity in the .jar file. I don't know why but there are @Entity pojos in the .jar file.)
    I'd like to use the existing persistence.xml, but if I can't is there is a way to create an EntityManagerFactory (or EntityManager) that gets its datasource directly from Glassfish, ignoring persistence.xml?
    Thanks.

    Styles in Pages are saved in the documents (or templates). There is no easy method for adding a style to a built-in template (and it is strongly recommended that you do not tamper with them). You can open a built- in template, add your style and save it as a user template so that your new style will be standard in documents created from that template.

  • Accessing classes in external jar files

    I have a jar file called main. I want it to be able to acces the classes in another jar file say test.jar how do i do this.
    Thank you

    ok, if i have this right...
    you have 2 directories that hold 2 .jars, right?
    plugins/ -------- build/plugins .jar
    systemModuals/ ------- DiaryUI and Loader .jar
    Your main JAR is diary?
    Diary.jar
    you want Diary to run with the jars inside plugins and systemmoduals?
    you set the "class-path:" tag like this....
    write this manifest file. save it as Manifest.txt and put it in your home dir.
    Main-Class: YourMainClass
    Class-Path: Diary.jar plugins/this.jar systemmoduals/diaryui.jar
    <make sure to hit enter, go to the next line>
    command line to your parent directory.
    jar cmf Manifest.txt Diary.jar build/main/*.class
    you should be set to go.
    use
    jar xf META-INF/MANIFEST.MF
    to read the present manifest that netbeans has created
    if necessary

  • Possible to create a JAR file from within a java app?

    Is it possible to create a jar file from within a java application?
    Can it be done more elegantly than by spawning-off another
    process with the Runtime and exec() portions of the api?
    Thanks
    Scott

    Thanks! I was mislead by the API notes for java.util.jar:
    The JarOutputStream class is used to write the contents
    of a JAR file to any output stream.
    I was looking for a class or method to make jar files.
    Seems this is it ;)
    Thanks
    Scott

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • How  to include the inner classes in a jar file in netbeans ide

    Dear java friends
    how to say to netbeans ide that it has to include the
    inner classes in the jar file.
    (i have one single applet class
    with two inner classes that show up
    in the build/classes file but not in the jar).
    The applet works in the viewer but not
    in the browser (I believe because the
    xxx$yyy etc should be in the jar)
    willemjav

    First, please stop posting the same question multiple times:
    Duplicate of http://forum.java.sun.com/thread.jspa?threadID=5269782&messageID=10127496#10127496
    with an answer.
    Second, If your problem is that you can't do this in NetBeans, you need to post to somewhere that provides NetBeans support - like the NetBeans website's mailing list. These forums do not support NetBeans (or any other IDE) - they are Java language forums.

  • How to call a function in one .js file from another .js file

    Hello Techies,
    I am trying to call a function in two.js file from one.js file.
    Here is my code
    one.js
    <script>
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
         function one()
                        var a;
                       two(a);
              }two.js
                  function two(a)
                          alert("two");
                      }But the function two() is not working.
    How can I do this one??
    regards,
    Krish

    I think there is a syntax error in line
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
    end tag <\/script> is wrong.

Maybe you are looking for