How to refer java class in c++

Dear All,
We have the requirement to access one java class from c++ program. Please share your ideas which will take me towards the right direction.
Thanks in advance

Naturally you can't do much with a java class without bringing in the whole machinery of the JVM and it's libraries. The mechanisms to run Java from another language (and vica versa) are in the JNI (Java Native Interface). This would allow a C++ program to load the JVM and a named java class and execute methods on it as well as doing the necessary type conversions.

Similar Messages

  • How to use java class in pl/sql

    Hai Guys,
    here is my java class:
    import java.io.*;
    public class ListFiles
    public static void main (String[] args)
    File file=new File("C:\\");
    File[] files=file.listFiles();
    for(int fileInList=0; fileInList<files.length; fileInList++ )
         System.out.println(files[fileInList].toString() );
    i want to use this class in pl/sql, i am new about this topic my concern are following
    how to load java class
    how to use in pl/sql
    Guys i'll be great-full to you if you could help me out or share link or document .

    First Read https://forums.oracle.com/forums/ann.jspa?annID=432
    Check this link...
    1. http://www.devshed.com/c/a/Oracle/Extending-PLSQL-with-Java-Libraries-concluded/
    2. calling java from pl/sql in oracle 10g?its very urgent.
    3. http://qamarsyed.blogspot.com/2010/07/calling-java-from-plsql-inside-oracle.html
    4. http://home.c2i.net/toreingolf/oracle/java_and_plsql.htm
    Hope this helps...
    If someone response is helpful or correct, please mark it accordingly.

  • How to import java Classes in report Builder 10g

    How to import java Classes in report Builder 10g .....
    Arshad

    Hello,
    To import the Java classes:
    Add your jar in the REPORTS_CLASSPATH
    Launch Reports Builder.
    Note:
    You must launch Reports Builder now so that the new REPORTS_CLASSPATH is used.
    Choose Program > Import Java Classes to display the Import Java Classes dialog box.
    Regards

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • How to decode  java class file to java file

    hi
    how to decode java class file into java file
    regards
    kedar

    Its really.......... really BAD.
    Write ur own code... or use open source code..
    Its a bad practice...
    however i am telling u ..there is DJ java decompiler.
    but mind it there are Obfuscator also....like codeshield and others
    take care...
    Alok

  • How to call java class from pl/sql procedure ?

    Hello everyone,
    My query is..
    There is one pl/sql stored procedure which is doing some business logic and storing data in some columns of one table, suppose the table name is 'ABC' .. and the rest of columns of table ABC are getting updated using java class. Now my problem is whenever I insert data in ABC using store proc.. i have to call that java class so that it will update the rest columns ( why java class for updating the columns in ABC is ..because that logic cant be done from pl/sql proc.. it has to be done using java )
    and the other thing is.. oracle is in one machine and java is in another .. :(
    hope ..u can help me out !!
    Thank in advance !!

    but that updation have to be done from java code only.. we are using GIS tools .. have to create some shape files and update the column with that shape file.. so creation of shape file has to be done from java code only..
    so how to call java class file which is on another machine and oracle in another..

  • How to Refer a class of Model Layer From a Class of View Layer IN Struts?

    HI There !
    I am building an application on struts using JDeveloper 10.1.3.1. On Selecting New application and writing few classes this is my Application Hierarchy is like folowing:
    Application Name
    |___ Model (Project given by Jdeveloper)
    | |_____ Application Resources
    | |________ model (Package)
    | |__________ CheckUser.java
    | |__________ DataAccess.java
    |
    |___ ViewController(Project given by Jdeveloper)
    |________ Application Resources
    |__________ View (Package)
    |__________ logon.java
    I tried to use CkeckUser.java in logon.java by importing the package model.
    But Jdeveloper is showing an error which means that this Package is not available here.
    So then how I can refer this class at View layer classes.

    Hi Ankur,
    I'm facing the same problem, i need to access a method in the AppModuleImpl but when i try to call it from an action in my viewController this error pops out:
    Error: cannot access class oracle.jbo.server.ApplicationModuleImpl; file oracle\jbo\server\ApplicationModuleImpl.class not found
    Did you have some advances with this?
    Please let me know
    Thanks

  • How to convert java class file version without decompiling

    Hi,
    Oracle R12.1.3 i am having illegal access error while try to access the class file version Java 1.3 uses major version 47,So how to convert the class file version without using decompiling.
    Current java version is 1.6.0_07
    Is there any tool or API for converting class file version?
    Thanks,
    Selvapandian T

    Beside this I wonder where you get your error from since AFAIK 12c comes with java 1.6.
    Well wonder no more!
    OP isn't using Oracle 12c database.
    They are using Oracle R12.1.3 - which is the E- Business Suite.

  • How to use java classes of DC1 in DC2

    When I was trying to use a java-class from another DC, I stumbled into an error I didn't expect:
    java.lang.NoClassDefFoundError: com/company/application/utils
    This is what I did to get this far:
    1. Created an empty Web Dynpro DC (DC1), to be used as a utilities library.
    2. Added a Java class to the webdynpro project.
    3. Added the class to a public part of type compilation.
    4. Created a second Web Dynpro DC (DC2), which is supposed to consume the class from DC1.
    5. Added a DC-usage relation, so that DC1 is in DC2's used DCs. In this usage-relation built-time and run-time were checked
    5. Used DC1's class in DC2's component controller
    6. Built both DCs and deployed them
    7. Ran the application in DC2.
    When I run the application, the application dumps a stack trace at the moment that and object is created based on the class in DC1.
    Any idea how to get this working?

    Vincenzo, here is the real error message:
    java.lang.IllegalAccessError: tried to access method nl.phoqus.pataut.Guid.getGuidString()Ljava/lang/String; from class nl.phoqus.pataut.PatientAuthorization
    I have inserted a very simple GUID generator that I used in a previous project. Please find the class file below:
    package nl.phoqus.pataut;
    import java.util.Random;
    public class Guid {
         private static Guid guidFactory = new Guid();
         static Random random = new Random();
          * Allow global replacement of the GUID generator.  Applications
          * wishing to install their own GUID generators should sub-class
          * Guid, override the getGuid() method, and use this method to
          *  install their generator.
         public static void
         setGuidImpl(Guid factory) {
         guidFactory = factory;
          * Return a GUID as a string.
         public static String getString() {
         return guidFactory.getGuidString();
          * Return a GUID as a string.  This is completely arbitrary, and
          * returns the hexification of a random value followed by a
          * timestamp.
         protected String getGuidString() {
            long rand = (random.nextLong() & 0x7FFFFFFFFFFFFFFFL) | 0x4000000000000000L;
            return Long.toString(rand, 32) + Long.toString(System.currentTimeMillis()&0xFFFFFFFFFFFFFL, 32);
    I'm calling the class using the following statements from the component controller of DC2:
    Guid x = new Guid();
    String y = x.getGuidString();
    The component controller resides in package package nl.phoqus.pataut.
    Would that be the problem?

  • How to create java classes when multiple xsd files with same root element

    Hi,
    I got below error
    12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. 'resultClass' is already defined
    12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. (related to above error) the first definition appears here
    12/08/09 16:26:38 BST: Build errors for viafrance; org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.1:generate': Mojo execution failed.
    I tried genarate java classes from multiple xsd files, but getting above error, here in .xsd file i have the <xe: element="resultClass"> in all .xsd files.
    So I removed all .xsd files accept one, now genarated java classes correctly. but i want to genarte the java classes with diffrent names with out changing .xsd
    Can you please tell me any one how to resolve this one......
    regards
    prasad.nadendla

    Gregory:
    If you want to upload several Java classes in one script the solution is .sql file, for example:
    set define ?
    create or replace and compile java source named "my.Sleep" as
    package my;
    import java.lang.Thread;
    public class Sleep {
    public static void main(String []args) throws java.lang.InterruptedException {
    if (args != null && args.length>0) {
    int s = Integer.parseInt(args[0]);
    Thread.sleep(s*1000);
    } else
    Thread.sleep(1000);
    create or replace and compile java source named "my.App" as
    package my;
    public class App {
    public static void main(String []args) throws java.lang.InterruptedException {
    System.out.println(args[0]);
    exit
    Then the .sql file can be parsed using the SQLPlus, JDeveloper or SQLDeveloper tools.
    HTH, Marcelo.

  • How to Transport Java Classes used in Mapping?

    Hi XI experts,
    Within the development of one message mapping, some external  java classes are imported and used in my UDF(user defined function). My question is: how will these external java classes be transported to the QA/PRD system? If I choose to use the file system transport method, do I have to manually find these jar files and transport them separately?
    Any comments or suggestions are highly appreciated.
    Thanks in advance
    Luis

    Hi Luis,
    Normally Mapping programs and External Jars are used in XI using Imported Archive. So this Imported archive once activated will become part of your SWCV and can be transported automatically with the SWCV.
    You dont have to worry about transporting it seperately, it will be avilable once you transport your SWCV using File system transport.
    Hope this helps,
    Regards,
    Ananth

  • How to use JAVA class in C++

    Hi people,
    is there anyone who knows how I can create and use JAVA class in C++ code. Example I have one JAVA class which works with database.
    One of the methods from this class returns XML string that represent result set. How to create instance of this class inside of C++ and have possibility to call this method.

    Hi, I'm also curious how to solve this.
    My problem is that I call a DLL from C++ that returns several values (e.g. function(a, b, c, &w, &x, &y, &z); )
    and I want to create a java class object that can be used to store these values so I can return 1 object
    Below I've written an abstract of the code
    Can someone help me with the parts in <> ??
    Thanks!
    Sander
    JNIEXPORT jobject JNICALL Java_nativeF(...a,b,c...)
       int w,x;
       float y,z;
       C_DLL_Function(a, b, c, &w, &x, &y, &z);
       //<Create Java Class 'Data' jobject>
       //<Call Data.setvalues(w,x,y,z) >
       return jobject;
    ...in java...
    class Data
      private int jw, jx;
      private float jy, jz;
      public function setvalues(int w, int x, float y, float z)
        jw = w;
        etc... 
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to call Java class from Forms 6i?

    Hi friends,
    I need to call a Java class from my Forms 6i application.
    (It runs under WIndows XP. It's a client/server application and I have only the client and the Form builder installed on my PC)
    I don't know almost anything about Java's world so your help would be very useful for me.
    Could you tell me exactly what i have to do?
    I've read in metalink several Notes, but they supposed that the Java architecture is already installed in the computer.... I only have the default installation of Developer 6i... so I would need to know:
    - How to install/configure the neccesary to execute Java classes without problem
    - How to invoke the .class from Forms 6i.
    Thanks a lot
    Jose.

    And also this one:
    Problem Description
    Installed Forms 6i Rel 2 on a MS Windows machine. When trying to Import the Java
    Classes getting the errors
    PDE-UJI0001 Failed to create the JVM
    Solution Description
    You need to to install JDK 1.2.2 to run the Java Importer. And set the PATH's
    and classpath's correctly.
    Explanation
    1. Download and install the JDK 1.2.2.
    Possibly available at: http://java.sun.com/products/archive/
    2. Assuming the JDK 1.2.2 is installed in c:\jdk1.2.2 directory and the JRE in
    C:\PROGRA~1\JAVASOFT\JRE\1.2 directory; ORACLE_HOME=C:\Dev6iR2.
    Set the PATH to
    set PATH=c:\jdk1.2.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin\classic;%PATH%
    ( If you are using ias9i then the JDK 1.2.2 comes with the ias installtion ,
    in this case please set the PATH to
    D:\ias9i\Apache\jdk\bin;D:\ias9i\Apache\jdk\jre\bin;D:\ias9i\Apache\jdk\jre\bin\classic;%PATH% )
    3. Set the CLASSPATH to set CLASSPATH=%CLASSPATH%;C:\Dev6iR2\TOOLS\COMMON60\JAVA\IMPORTER.JAR;.
    (If you do not set the CLASSPATH correctly you will get the error
    PDE-UJI002 Unable to find the required java importer classes)
    4. Now run the Forms Builder by using the command.
    C:\Dev6iR2\bin\ifbld60.exe
    Now the Java Importer Should Run fine.
    Francois

  • How to call java classed in forms 10g

    Hi
    I am using forms 10g
    There is a java class email_class (to send emails and attachments). this java class (email_class) has further used two moere .jar files (activation.jar & mail.jar).
    Now I want to use this java class (email_class) in my form to send email and attachment.
    Could you please help me how can I do that?
    regards

    The jar file must be included in CLASSPATH which is set in the Forms default.env (or your own custom env if you created one). If you have not jar'd the class files, then the path to the class files should be included in CLASSPATH. Here is a simple example. Your CLASSPATH will contain many more entries.
    CLASSPATH=D:\oracle10g\iDS1012\j2ee\OC4J_BI_Forms\applications\formsapp\formsweb\WEB-INF\lib\frmsrv.jar;D:\oracle10g\iDS1012\jlib\share.jar;D:\oracle10g\iDS1012\jlib\utj.jar;D:\oracle10g\iDS1012\jlib\zrclient.jar;D:\oracle10g\iDS1012\forms\java\frmall.jar;D:\oracle10g\iDS1012\jlib\importer.jar;D:\oracle10g\iDS1012\forms\javaNotice that jar files are included in the path and the last entry is just a directory. In this case, if there are any class files which are not in a jar, they could be stored individually in the \java directory.
    Verify that you have at least the following included in your CLASSPATH:
    frmsrv.jar
    importer.jar
    share.jar
    utj.jar
    zrclient.jar
    Do not remove other entries which may exist as they are needed, but ensure that the list includes the above.

  • How to deploy java class as a service in weblogic

    All,
      I have a java class which polls on a mailbox. I want deploy this class as a service in weblogic so that when the service is started it should continuously poll the mail box untill the service is stopped. Its working as a standalone component, i want to deploy this as a service.
    Thanks,
    Ram

    if you want to set Startup Classes, please refer the following URL,
    Startup Classes: Configuration

Maybe you are looking for

  • Spry Collapsible panel and ul

    I've got 5 spry collapsible panels in a page, each panel with <ul>'s inside them. Now whats happening is when you click to open a panel the <ul> is appearing and overlapping all the other panels while the panel is opening, rather than gradually appea

  • X11 errors with mono and keepass

    I've been trying to get KeePass running to no avail. I've tried custom mono installations as well as pacman installations. I'm using the most recent portable version on keepass.info.I receive the following as an error and would appreciate any guidanc

  • Lightroom 2 system requirements

    I have recently purchased Lightroom v2, but not yet installed it. Before doing so I wanted to check that my PC is capable of running it. 'Minimum' requirement is for a Pentium 4 procesor, which I do not have, though I meet all other requirements. Doe

  • My powerbook goes crazy!

    Recently it happens regularly (up to 5 times in an hour!!!) that the desktop fades and in the center of the screen the message appears that the i have to shut it down by holding the power down for several seconds. - does anybody know why this happens

  • Pdfs squished onto half page

    I upgraded pdf complete to adobe reader, and now all pdfs saved by my turbotax2011 appear squished onto half pages, as though all the text were being pushed onto the left side of the page. Im not sure if this is an issue with turbotax itself, or adob