User defined classpath setting using "-Djava.class.path="

Hello,
I am invoking a JVM from a C++ application ( say A ) which inturn will be started by another C++ application ( say B ).
The class path for the JVM is set by "-Djava.class.path=" option in application 'A' which will actually supplied by parent application 'B'.
I want to know how to do it ?
I tried with the following things but it doesn't work.
// the application 'A' gets classpath string from appication 'B' the "classpath" variable ( which is a string ) gets from application 'B'
// this is in application 'A'
// "classpath" variable in application 'A' holds the class path string optained from application 'B'
"-Djava.class.path=" classpath ; ---(1)
// "-Djava.class.path=" %classpath% ; ---(2)
// "-Djava.class.path=classpath" ; ---(3)
All the above tries are failed in first 2 tries the application even doesn't get compiled and in third try the appilcation doesn't set the classpath even though it is get compiled.
Do any one have any Idea !!

Hi,
I am not quite sure if I got your problem correctly...
Your application A has a variable called classpath containing the classpath recieved from B. right? Now you want to call the JVM with that.
I think what you got to do is something like
sprintf(myclasspath, "-Djava.class.path=%s", classpath);
this will build the correct string for the JVM in myclasspath. And that one can be used to call the JVM.
Does this sound right??

Similar Messages

  • Dont want to hard code the -Djava.class.path...notation question

    Hello everyone,
    I have a c++ program that is compiled into a DLL file. It calls the JNI_CreateJavaVM. I have the whole thing working but now I need to port it and the jar file to another machine.
    right now i am setting the options this way:
    #define USER_CLASSPATH "c:\\javaClasses\\intec.jar.zip" /* where PRLocalBridge.class is */
    #define PRCLASS "com/intec/intecapi/PRLocalBridge"
    bool PRLocalBridgeMain(){
         JavaVMOption options[1];
         options[0].optionString = "-Djava.class.path=" USER_CLASSPATH;
         vm_args.version = JNI_VERSION_1_4;//0x00010002;
         vm_args.options = options;
         vm_args.nOptions = 0;
         vm_args.ignoreUnrecognized = JNI_TRUE;
        /* Create the Java VM */
        res = JNI_CreateJavaVM(&jvm, (void**)&env,&vm_args);
        if (res < 0) {
         return (bool*)errorHandler('b', CANT_INVOKE_JVM);
        cls = env->FindClass(PRCLASS);
    }where USER_CLASSPATH is hardcoded directly to where the jar
    file is located. in other machines, it may not be loaded
    in that file structure. how do i softcode the path?
    ive put the jar in my classpath but that doesnt seem to work
    (unless i didnt have USER_CLASSPATH set properly). Thanks
    in advance :)
    txjump

    hi bschauwe,
    thanks for the suggestions! i was hoping you would reply. You have helped some others with classpath questions. :)
    since its a dll, can you pass it values?
    we do have an ini file that is already created but the file parser is in java so i would have to write another one in c. id like to stay away from that though. cause if it gets messed up or goes missing, clients wont be able to reach the java program, and in turn the database.
    the classpath environment variable sounds like a good idea...will check into that. eventually we plan to wrap our software up in installshield so that would really be nice. clients could be ignorant of environment variables and still be able to run everything.
    my solution for now has been to find my jar file by recursively searching the c drive. and use GetFilePath() to get the full path and pass that to JNI_CreateJavaVM. i did get it to work...just wondering if this is a good idea.
    i was thinking that if the dll is in the same folder as the jar file i could just use dot notation but that just doesnt seem like a good idea to make that assumption. but i think java does something similar 'cause Sun says not to move the java.dll file.
    thanks for your input,
    txjump

  • Can I call a User-Defined Mathscript Function using LabVIEW 7.1?

    I am trying to use a User-Defined function call in a mathscript node using LabVIEW 7.1 and I cannot seem to make it work.
    For example, consider that my mathscript node contains:
    clear all;
    close all;
    x = linspace(1,100,5);
    y = mltp(x);
    where the labview vi is saved in the same folder as the mathlab script mltp.m that is given by:
    function out1 = mltp(in1)
    out1 = 5*in1;
    Creating an array output of the mathscript node for y yields an empty array.
    How can I use User-Defined functions in a mathscript node using LabVIEW 7.1?

    Hello,
    LabVIEW 8.2 did not yet have the MathScript page in Tools >> Options.  In this version, you need to set the search path through the MathScript Window.  Launch the window from Tools >> MathScript Window.  Then go to File >> MathScript Preferences.  It sounds like you have done this.
    A first guess is that your .m file calls some unsupported functions or uses unsupported syntax.  If that were the case, you could put the script in the Script Editor of the MathScript Window and select the "Save and Compile Script" menu item.  This will return any errors from compiling the script.  However, you said you simplified the problem to a single multiplication.  Since this still does not work, I need more information.  What are all the directories listed for the path in the MathScript Preferences dialog from the MathScript window?  What is the working directory?  Where is your .m file located on disk?  Can you attach your .m file or paste the contents in your message?
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • Classpath Setting using win 98

    Please help me in this little delima.
    I want to set the classpath in win 89 and i am not finding any way of doing this correctly . Can any one tell me how can i set the class pathe in win98 environment.
    Actually i am installing Tomcat and i have to set the environment verivable for this and i dont know how can i do it in win 98 environment.

    There's a handy little tool called sysedit.exe in Win98 that you can use to edit the 4 common config files:
    autoexec.bat
    config.sys
    windows.ini
    system.ini
    just open a command window and type sysedit.
    Don't forget to reboot after you've made changes.
    You may have to increase the environment size if you increase the classpath by much. There have been recent posts about how this is done.

  • Fail to create web service with user-defined data type using jwsc Ant task!

    Hello every body!
    I used JAXWS to create WSDL from a jws file.
    This is my jws:
    package ws;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import ws.MyDataType;
    *@WebService*
    *public class MyWebService {*
    public MyWebService()
    *@WebMethod*
    public MyDataType MyWebMethod(MyDataType mdt)
    *// mdt.setS("I got it!");*
    return mdt;
    and this is my data type:
    package ws;
    *public class MyDataType {*
    String s;
    public MyDataType()
    *public String getS() {*
    return s;
    *public void setS(String s) {*
    this.s = s;
    and this is my Ant build.xml
    *<project default="all">*
    *<property name="weblogic.jar.classpath" value="D:/Projects/bea103/wlserver_10.3/server/lib"/>*
    *<taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask">*
    *<classpath>*
    *<path id="weblogic.classpath">*
    *<pathelement path="WEBLOGIC_HOME"/>*
    *<fileset dir="${weblogic.jar.classpath}">*
    *<include name="weblogic.jar"/>*
    *</fileset>*
    *</path>*
    *</classpath>*
    *</taskdef>*
    *<target name="all" depends="clean,build-service"/>*
    *<target name="clean">*
    *<delete dir="output"/>*
    *</target>*
    *<target name="build-service">*
    *<!--add jwsc and related tasks here -->*
    *<jwsc srcdir="" destdir="wsoutput">*
    *<jws file="MyWebService.java" type="JAXWS"/>*
    *</jwsc>*
    *</target>*
    *<!--<target name="deploy"> --><!--add wldeploy task here --><!-- </target>-->*
    *</project>*
    I run the Ant task but I get this error:
    Buildfile: build.xml
    clean:
    build-service:
    [jwsc] JWS: processing module /MyWebService
    [jwsc] Parsing source files
    [jwsc] Parsing source files
    [jwsc] 1 JWS files being processed for module /MyWebService
    *[jwsc] [JAM] Warning: failed to resolve class MyDataType*
    [jwsc] JWS: C:\Documents and Settings\samimi\IdeaProjects\SampleWebService\src\ws\MyWebService.java Validated.
    [jwsc] Processing 1 JAX-WS web services...
    *[jwsc] error: Could not get TypeDeclaration for: MyDataType in apt round: 1*..........
    BUILD FAILED
    C:\Documents and Settings\samimi\IdeaProjects\SampleWebService\src\ws\build.xml:
    19: weblogic.wsee.tools.WsBuildException: Error processing JAX-WS web services
    Please help me to solve this issue.
    Thank you,
    Mojir

    Thank u very much Jay SenSharma this was helpful
    and thank u sandeep_singh this is the answer,
    I find another answer too :
    adding my class files to the path remove the error:
    <project default="all">
    <property name="weblogic.jar.classpath" value="D:/Projects/bea103/wlserver_10.3/server/lib"/>
    <taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask">
    <classpath>
    <path id="my.path">
    <pathelement path="D:/Projects/bea103/jdk160_05/lib/tools.jar"/>
    <pathelement path="D:/Projects/bea103/wlserver_10.3/server/lib/weblogic.jar"/>
    *<pathelement path="D:/Projects/LifeInsurance Project Original/BusinessModule/classes/"/>* adding this line solved my problem.
    <pathelement path="${java.class.path}"/>
    </path>
    <path id="weblogic.classpath">
    <pathelement path="WEBLOGIC_HOME"/>
    <fileset dir="${weblogic.jar.classpath}">
    <include name="weblogic.jar"/>
    </fileset>
    </path>
    </classpath>
    </taskdef>
    <target name="all" depends="clean,build-service"/>
    <target name="clean">
    <delete dir="output"/>
    </target>
    <target name="build-service">
    <jwsc sourcepath="mytype" classpathref="my.path" debug="true" srcdir="" destdir="wsoutput">
    <jws file="NegotiationService.java" generatewsdl="true" type="JAXWS"/>
    </jwsc>
    </target>
    </project>
    Thank u very much,
    Mojir

  • How to display a  User defined  symbol when using addLinearFeature

    Hi ,
    We are displaying our DataBase spatial data in the form of image on to the browser .
    With the help of MapViewer mv.addLinearFeature i am able to draw lines on to it .
    I have created styles in MapBuilder for our userdefined symbols and added to Mapviewerconfig file .
    Now as per our requirement we need to put our user defined symbols in the middle of the line when a line is drawn using addLinearFeature
    For example Like This :
    Assume that (::) this is our symbol .
    Please tell me how to do this .

    You could use the marker (user defined symbol) as a label for the line. Something like the highways theme/style definition in the mvdemo example where the highway shield is a marker.
    SQL> select styling_rules from user_sdo_themes where name='THEME_DEMO_HIGHWAYS';
    STYLING_RULES
    <?xml version="1.0" standalone="yes"?>
    <styling_rules >
    <rule >
    <features style="L.PH"> </features>
    <label column="ROUTEN" style="M.SHIELD1"> 1 </label>
    </rule>
    </styling_rules>
    SQL> select definition from user_sdo_styles where name='M.SHIELD1';
    DEFINITION
    <?xml version="1.0" standalone="yes"?>
    <svg width="1in" height="1in">
    <desc></desc>
    <g class="marker" style="width:20;height:18;font-family:sansserif;font-size:9pt
    ;fill:#ffffff;text-style:[t.shield1]">
    <image x="0" y="0" width="9999" height="9999" type="gif" href="dummy.gif"/></g>
    </svg>
    SQL>
    The content of ROUTEN (column/attribute) is displayed in the marker (m.shield1).
    Will something similar work or is your requirement different?
    If its to simply display a marker (i.e. your user defined symbol which is in the database user_sdo_styles view) somewhere along the line then use a line style definition like (see Appendix A of the user guide):
    <?xml version="1.0" standalone="yes"?>
    <svg width="1in" height="1in">
    <g class="line" style="fill:#33a9ff;stroke-width:4;
    marker-name:M.IMAGE105_BW;marker-position:0.15;marker-size=8">
    <line class="parallel" style="fill:red;stroke-width:1.0"/>
    </g>
    </svg>
    This will display the marker M.IMAGE105_BW at about 0.15th of the line length.
    If you want that marker repeated at fixed intervals (0.15 of line length in the following) then use
    <?xml version="1.0" standalone="yes"?>
    <svg width="1in" height="1in">
    <g class="line" style="fill:#33a9ff;stroke-width:4;
    marker-name:M.IMAGE105_BW;marker-position:0.15;marker-size=8;multiple-marker=true">
    <line class="parallel" style="fill:red;stroke-width:1.0"/>
    </g>
    </svg>

  • User defined Exception in Stateless Java Class WS

    Hi,
    I'm experimenting with publishing some of my application's Java classes as web services under OC4J 10.1.2. I've been quite successfull to do so, but I'm stuck into a problem trying to have my class's methods throw my own type of exception and retrieving it at the client side.
    I'm using the proxies downloaded from the web service's automatic HTML page, and I see in the source code version that the proxy class specifically throws a org.apache.soap.SOAPException whenever there's a fault in the response message.
    What I've done is simply to create a type derived from Exception with a String (message) and an Integer (code) properties, with just my own constructor that accepts two parameters corresponding to that properties. Then I make the methods in my Java class throw that exception.
    I've tried both using both an Interface and a class, and also using just a class as parameters to StatelessWebServiceServlet / Web Service Assembler.
    I can't find anywhere in any docs that explains how this can be done in OC4J. I believe that throwing user-defined exceptions is included in J2EE 1.4 and so I think that there should be a way to do it in OC4J if it is compliant. Maybe there's no way, but I couldn't find any reference to that neither.
    I'll greatly appreciate any light on this issue.
    Thanks in advance
    Juan Alvarez Ferrando
    Mensaje editado por:
    user517323

    Thank you for your answer.
    I'd like to know something more about how far does that limited support go, in case it could be of some use.
    On the other hand, and just for the sake of constructive discussion, though I've contemplated the option of encoding error conditions on the result type, I always found that to be an ugly style from a interface design standpoint (not ws specifically but in general system desing terms), and when I saw a standard way to communicate custom error information separated from normal response I thought it to be the right way to go. After all, exceptions are just the way Java implements this design principle that has also found a place in most currently successful software environments (PL/SQL, .Net, ...).
    I don't expect to extend the meaning and programmatic use of Java exceptions to my ws clients, but to be able to communicate detailed error condition information as the standards contemplate (faults), which as I understand from your kind answer is out of my reach in 10.1.2.
    I have no experience with other ws platforms but I'd like to believe that if wsdl:fault is in the standards, those claming compliance will support it to the extent necessary to make it usable and interoperable as it is the way the standard covers error communication (and so that's why it is included in 10.1.3). I also beleve this would bring better interoperability than our home-made result types including error information, that no other application without our custom specifications can understand.
    Also better interoperability would come from that than for example what I now see in 10.1.2, where all exceptions are communicated to the client with a faultcode of soap:Server, which I believe to have the standard meaning that there's a chance for the client to success retrying later without modifying it's request. This translation could be better suited for Java errors (unrecoverable) but not for all kinds of exceptions, and so in this question, custom exception support could also improve interoperability with systems that interpret SOAP fault codes.
    Thank you.
    Juan Alvarez Ferrando

  • How do I add the system classpath to Jar Manifest Class-Path

    My application is implemented on win2000 and need to be moved to unix as a executable jar file, the oracle jdbc classes (classes12.zip and classes111.zip) were included in MANIFEST.MF as the following:
    Class-Path: /Oracle/Ora81/jdbc/lib/classes12.zip /Oracle/Ora81/jdbc/lib/classese111.zip
    When I move the jar file to unix, the classpath will be changed, is there a way to make the jar file read the class-path from system CLASSPATH?
    Thank you.
    Y.

    I have the same problem for weeks now, and I can't seem to get it solved. If you found anything please inform me.
    thanks in advance
    Eran

  • User Defined Table Setting

    Hello Experts,
    I created the User Defined Table in the name of SR NO where i entered the Docment No in Code Field (System generated default field).When i add the Document Number serially when i saved the UDT table then my serial sequence has changed.Could anyone help me out from these problem.
    Regards
    Amol

    Hi Suraj,
    These is my Query when i tried to run @PPC Table then it will not sort the Code & Name the details contain all the information.
    If u have any query please ask.
    SELECT T0.[Code], T0.[Name], T0.[U_0001] as 'Purchase Order No',T0.[U_0002] as 'Sr No', T0.[U_0003] as 'Item Code', T0.[U_0004] as 'Item Description' , T0.[U_9999] as 'Plan Qty', T0.[U_0005] as 'P O Qty', T0.[U_0006] as 'GRN No', T0.[U_0007] as 'GRN Date' , convert(varchar,T0.[U_0008]) as 'Batch Num',convert(varchar,T0.[U_0009]) as ' Heat Num', T0.[U_0010] as 'GRN Qty', convert(varchar,T0.[U_0011]) as 'RM Size',convert(varchar,T0.[U_0012]) as 'Length' , convert(varchar,T0.[U_0013]) as 'Pieces' , convert(varchar,T0.[U_0014]) as 'SO Num' , T0.[U_0015] as 'SO ROWNUM' , T0.[U_0016] as 'SO ItemCode' , T0.[U_0017] as 'SO Item Description' , T0.[U_0018] as 'SO Qty' , T0.[U_0019] as 'SUPP Name'  , T0.[U_0020] as 'Cust Name', T0.[U_0021] as 'Open PO Qty' ,convert(varchar,T0.[U_0022]) as 'SO Tol Size' , T0.[U_0023] as 'SO Condition' , T0.[U_0024] as 'SO Size' , T0.[U_0025] as 'SO Length' , T0.[U_0026] as 'Remarks' , T0.[U_0027] as 'Planning Date' , convert(varchar,T0.[U_0028]) as 'SO Dia MM' , T0.[U_0029] as 'Plan Pieces' , T0.[U_0030] as 'Stock Condition' FROM [dbo].[@PPC]  T0 ORDER BY T0.[U_0008]
    Regards
    Amol

  • User defined attributes for use with personalization

    Hello,
    I have a stand alone region that works correctly and is able to be added to seeded pages via personalization. I would like to allow the personalization to define the value of a user defined attribute when the personalization is added to the page. However I do not see any user defined attributes in the list when I add the region via personalization.
    Has anyone ever done this before?
    Kristofer Cruz

    If you are not drawing this in an JEditorPane, but just with DrawText, you will have to split the text up your self, draw the first half, then switch colors, then draw the second half.

  • SBO crashes on changing user defined field setting for a form

    Hi,
    when i try to change the user defined field settings(Tools->User-Defined Fields->Settings) for a form, say Sales order form, on clicking on OK button SBO crashes displaying runtime error messagebox.
    This happens only when my addon is running.
    Anyone encounter this behavior?
    Thanks,
    Satish.

    Hi Barend,
    I have put in the filters.The form 38(user-defined fields settings form) is not included in the filters.So it should not get any events. I get the following error
    Microsoft Visual C++ Runtime Library
    Runtime Error!
    Program ..m Files\SAP Manage\SAP Business One\SAP Business One.exe
    This application has requested the runtime to terminate it in an unusual way.Please contact the application's support team for more information.
    Thanks,
    Satish.

  • Not well defined classpath when using XML-RPC

    Hello,
    im trying to setup a webservice using XML-RPC
    I get real time ClassNotDefined exceptions, and all i can suppose, i haven't set up the classpath correctly.
    I must inform you, that i've allready put the xerces.jar, xmlrpc-1.2-b1.jar (and so on...) at my (JAVA_HOME)\jre\lib and (JAVA_HOME)\jre\lib\ext folders. I use the following statements :
    import java.io.IOException;
    import org.apache.xmlrpc.*;
    import org.apache.xerces.parsers.*; //for the server-side
    import java.io.IOException;
    import java.util.Vector;
    import org.apache.xmlrpc.*;
    import org.apache.xerces.parsers.*; //for the client-side
    I've allready worked with SAXParsers and jdom, but i think that the classes i used there are distributed with the standard jdk-1.4 version i use.
    So, any suggestions? How can i setup my classpath for the XML-RPC programms, if that's the problem?
    Any help would be very very appreciate
    Thank you

    Thanks, I'll have the dev team take a look and put in a fix.

  • Can we load data using .xls in user define format(without using default template)

    Hi All,
    I'm new bee to FDM. Part of HFM support i use FDM to load flatfile data. Just has a bit more knowledge than end user.
    Requirement is that i need to load data from MS excel to Planning application via FDM.
    Previously application is in Excel(Macro driven) and upstream(data) is also in Excel(multi tab).
    As of my knowledge data can be loaded from .csv file(Excel save as CSV) with single tab.
    Could you please let me know possibilities to load data from .xls(.xlsx) to FDM.
    Thanks in advance.

    If you want to load data using Excel, utilising FDM's out-of-the-box functionality you will have to use one of the templates supplied i.e. Excel Trial Balance or Excel Multi-load template.

  • Classpath setting for oracle classes 12 in unix environment

    hi all,
    i am trying to exceute java program with JDBC statements in it. I am running the code on a remote machine which has both JDK1.4 and oracle 9.i installed .I am accessing the remote machine through PUTTY .can any one suggest how to set the classpath in UNIX environment for oracle.
    Thanks

    Same way you do it else where:
    java -cp <classpath>

  • Windows XP to Windows 7 - user desktop wallpaper setting using USMT

    Hi, 
    I am using offline hardlink for migrating XP to Windows 7 . I am observing that user desktop background is not migrated . Is there any changes i need to make to .xml file to include user desktop settings or it should happen automatically by default .xml
    file with USMT? 
    Any pointers will be appreciated. Thanks. 
    Regards,

    Here is the list of the Non-migrated items by USMT.
    1. USMT does not migrate between differing localized versions of the operating system.  This does not include MUI language packs.
    Example:  You cannot migrate from a French localized OS to an English OS
    2.USMT does not migrate settings between different versions of supported applications
    Office is an exception to this rule.  USMT will migrate settings between different versions and languages of Office.
    Also note that IE is treated as an OS component and is also exempt from this rule.
    3. Hardware-related settings
    4. Drivers
    5. Passwords
    6. Application binary files
    7. Synchronization files, .dll files, or other executable files
    8. Local Printers
    9. Network Printers (when the target OS is XP)
    10. Default Wallpapers
    Thanks, Prabha G

Maybe you are looking for

  • Audigy Platinum and 56K PCI modem confl

    I have had modem connection problems so I reformatted the hard dri've and reloaded the OS to get a clean start. Now, I have a conflict with the Audigy Platinum and 56K PCI modem. The sound card works great until I dial-out on the modem - at that poin

  • Problem extracting InDesign CS5.5 trial - error message "illegal seek"

    Hi, trying to download Indesign trial CS5.5 I think the file downloads, however when it trys to extract I get a box appear saying "the following disc images could not be installed; InDesign_7_5_LS1.dmg - illegal seek" I can't open from the actual  fi

  • Using Panorama Maker 4 with iPhoto troubles...

    I searched and could not find anything so i decided to post. I wanted to mess around with Panorama Maker so i took a couple pics of my room and imported them into my iPhoto. After i did so, i opened up Panorama Maker and i couldn't find any of the ph

  • How can i turn off internet access for itunes

    Every time i turn on itunes it asks for my internet username and password. If I cancel the request it pops up again after a few seconds and will continue to pop up, even if I put my name and password in. This becomes very frustrating when I don't wan

  • How can i transfer my music from my old ipod to my new ipod?

    i have an 120g ipod classic, i just recently purchased a 160g ipod classic. i want to transfer my music from my 120g to my 160g, but i dont have the music saved in my computer and i dont want to look my cd's to reinstall the music either. can someone