Javac.exe  is not using classpath, while java.exe is.

I'll state the problem, then give my configuration. This does NOT seem to be a duplicate of other problems. I am running Windows NT sp 6a.
INTRO:
javac.exe, java.exe in directory E:\v\bin.
file HelloWorld.java is in directory E:\v\lib\x\y (dir names shortened)
PROBLEM:
Once HelloWorld is compiled (and HelloWorld.class is in E:\v\lib\x\y ), I can run the exact command "java HelloWorld" from ANY directory anywhere and it runs and prints Hello World!.(So java.exe seems to be using classpath.)
However, to compile, the command "javac HelloWorld.java" does not work (say in E:\v). The error message is "cannot read: "HelloWorld.java". I have to provide the full path name for HelloWorld.java, thus: "javac E:\v\lib\x\y\HelloWorld.java". This works, from any directory anywhere. In other words, javac.exe does NOT seem to be using classpath.
CONFIGURATION:
CLASSPATH is set to E:\v\lib\x\y in both system and user environment and ALSO through both javac -classpath and java -classpath. (When I run javac -classpath E:\v\lib\x\y, the list of options is not printed out, and I think this means the classpath is supposed to be set. ) I also tried setting sourcepath for javac, but that did not help.
PATH is set since and the system recognizes the commands "java" and "javac" from any directory anywhere (each brings up the list of options.)
Any thoughts.

let's read the documentation first shall we ...
http://java.sun.com/j2se/1.4.1/docs/tooldocs/windows/javac.html
According to it the command line arguments must be file names. The compiler "cannot read HelloWorld.java" because it simply is not in the current working directory. You need to specify a path to the file. It is only after that, "when compiling a source file", that the classpath or sourcepath setting has any effect.

Similar Messages

  • Bursting control :DocumentProcessor does not use translation while bursting

    Hi
    We are trying to use the bursting feature in BI Publisher using the DocumentProcessor class/APIs.
    The java code is :
    import oracle.apps.xdo.batch.DocumentProcessor;
    public class BurstingTest
    public BurstingTest()
         try {
              DocumentProcessor dp = new DocumentProcessor ("bursting_cntl.xml", "test.xml","temp");
              dp.process();
    catch (Exception e) {
    System.out.println(e);
    public static void main(String[] args)
    BurstingTest burst1 = new BurstingTest();
    The bursting control file is :
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
    <xapi:request select="/XXG_ACCOUNTING_CNDN_REPORT/G_Cust">
    <xapi:delivery>
    <xapi:filesystem id="file1" output="C:\Projects\XDO\RTF_TO_PDF\output\${cust_name}.pdf"/>
    </xapi:delivery>
    <xapi:document output-type="pdf" delivery="file1">
    <xapi:template type="rtf" locale="fr-FR" location="C:\Projects\XDO\RTF_TO_PDF\test.rtf"
    translation="C:\Projects\XDO\RTF_TO_PDF\test_fr_FR.xlf" >
    </xapi:template>
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    The XLF file has the necessary translations. Source en-US and target fr-FR.
    However, I see that the translations are NOT being picked by the DocumentProcessor. The bursting does happen successfully, however I don't see the translations in the PDF.*
    Am I  missing something here? Probably some flag that I need to set or something of the kind?
    A section of the XLF file is as shown below :
    <?xml version = '1.0' encoding = 'utf-8'?>
    <xliff version="1.0">
    <file source-language="en-US" target-language="fr-FR" datatype="XDO" original="orphan.xlf" product-version="orphan.xlf" product-name="">
    <header>
    <prop-group name="ora_reconstruction">
    <prop prop-type="extractorVersion">5.6.3_120.1</prop>
    </prop-group>
    </header>
    <body>
    <trans-unit id="5dacac6a" maxbytes="4000" maxwidth="56" size-unit="char" translate="yes">
    <source>Please confirm the above information.</source>
    <target>Merci pour confirmer l'information mentionee</target>
    <note>Text located: body</note>
    </trans-unit>
    <trans-unit id="366403c2" maxbytes="4000" maxwidth="23" size-unit="char" translate="yes">
    <source>Dear [&amp;0],</source>
    <target>Cher [&amp;0],</target>
    <note>Text located: body</note>
    </trans-unit>
    <trans-unit id="ce145901" maxbytes="4000" maxwidth="23" size-unit="char" translate="yes">
    <source>Invoice Date</source>
    <target>Date de la facture</target>
    <note>Text located: body/table/table header</note>
    </trans-unit>
    Request you to revert as soon as you could.
    Thanks and Regs
    Krish
    Edited by: user11131627 on Nov 8, 2009 10:16 PM

    Ike
    Yes, I believe the translation element is defined.
    Referred to this post about that :
    http://blogs.oracle.com/BIDeveloper/2009/06/bursting_translation.html
    Also, we did try using the translation element thru' Apps and submitted as a standard concurrent program.
    The translation fie was used correctly.
    My question is :
    How do I force the usage thru' my custom Java program and in which I use DocumentProcessor?

  • Discoverer Does not uses partitions while running report

    Hello All,
    I am noticing a strange thing in Discoverer 9i desktop and i.e
    I have my table partition based on Trx date and when I am using trx date as a parameter in my report why it is doing full scans for all the partition across the table...?
    Because of this even a reports for single day takes hours..
    Any help will be higly appreciated.....

    Hello Rob,
    Below information has really help me a lot.It made to look at probable cause..And it was Really funny one.
    The report was using a parameter as Trx Date and range partition at back end was on another date field. :).
    I just joined a comp week ago and was wondering why a report for single date take 2-3 hr to execute....And I was not sure of this discoverer version...
    Thanks again for help....
    Devang Shah

  • How to persuade MS IIS to not use the MS Java VM

    An odd question perhaps: Now that Microsoft has announced its retreat from Java, I am required to find a way to persuade MS's IIS (their Web Server) to use a Java VM other than theirs (msjava). I am talking about the use of Java by, say, a .asp document that uses something like:
    set obj = GetObject("java:<myclassname>")
    Does anyone know how to achieve this?
    /Mike Symes
    Soliton Associates Inc.

    Package your com-callable java class
    with ActiveX bridge.
    see: http://java.sun.com/products/javabeans/software/bridge
    and use
    Set obj = Server.CreateObject("My.Wrapper.1")
    Limitations exist....of course.
    Cheers'
    Kullervo

  • Can not use worklistmanager in  java client

    hi,
    I am writing a java client to call worklistmanager operations.
    i have a problem in locating bpel manager in the following code:
    Properties properties = new java.util.Properties();
    properties.setProperty("orabpel.platform", "ias_10g");
    properties.setProperty("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");
    properties.setProperty("java.naming.provider.url", "http://server1:9700");
    properties.setProperty("java.naming.security.principal", "admin");
    properties.setProperty("java.naming.security.credentials", "welcome");
    properties.setProperty("dedicated.connection", "true");
    Locator locator = null;
    try {
    locator = new Locator("default", "bpel", properties);
    } catch (ServerException ex) {
    ex.printStackTrace();
    //Lookup the delivery service using the Locator we created above
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
    exceptions:
    java.lang.Exception: Failed to create "ejb/collaxa/system/DomainManagerBean" bean; exception reported is: "javax.naming.NoInitialContextException: Cannot instantiate class: com.evermind.server.rmi.RMIInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.evermind.server.rmi.RMIInitialContextFactory]
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
    at com.collaxa.cube.util.CXBeanRegistry.lookupDomainManagerBean(CXBeanRegistry.java:209)
    at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:84)
    at com.oracle.bpel.client.Locator.<init>(Locator.java:127)
    at com.oracle.bpel.client.Locator.<init>(Locator.java:98)
    at temp_invoke_bpel_services.Main.main(Main.java:59)
    Caused by: java.lang.ClassNotFoundException: com.evermind.server.rmi.RMIInitialContextFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
    ... 8 more
    at com.collaxa.cube.util.CXBeanRegistry.lookupDomainManagerBean(CXBeanRegistry.java:225)
    at com.oracle.bpel.client.auth.DomainAuthFactory.authenticate(DomainAuthFactory.java:84)
    at com.oracle.bpel.client.Locator.<init>(Locator.java:127)
    at com.oracle.bpel.client.Locator.<init>(Locator.java:98)
    at temp_invoke_bpel_services.Main.main(Main.java:59)
    Exception in thread "main" java.lang.NullPointerException
    at temp_invoke_bpel_services.Main.main(Main.java:65)
    Java Result: 1
    best regards
    Message was edited by:
    asadi

    this cannot work
    properties.setProperty("java.naming.provider.url", "http://server1:9700");
    you try to use ormi against an http endpoint ...
    try ormi://server1/orabpel instead
    hth clemens

  • Classpath and java.exe, help me, guys

    if i don't use -classpath for java.exe, what else i can do which affects -classpath or class enviromnent?
    thx

    You can set the classpath in your system environment or in your IDE (if you use one)

  • Classpath, dos finds java.exe but not javac.exe

    Hi all,
    I have still been trying to have dos recognize the javac command. I have used many methods for updating the classpath and path in WinMe through the environment variable and in the autoexec.bat. I am using the J2SDK1.3.1_02. When I go to the proper directory and use the java command to run a .class file my simple "Hello" program runs fine. However, if I try to compile a new file ex. "Helloagain.java" using: javac Helloagain.java , I receive the "bad command or file name" message. This doesn't make sense because java.exe(which works), is in the same bin as javac.exe!
    My complete autoexec.bat file in notepad reads as follows:
    SET COMSPEC=C:\WINDOWS\COMMAND.COM
    SET windir=C:\WINDOWS
    SET winbootdir=C:\WINDOWS
    SET PROMPT=$p$g
    SET TEMP=C:\WINDOWS\TEMP
    SET TMP=C:\WINDOWS\TEMP
    SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\MSSQL7\BINN;C:\J2SDK1.3.1_02\BIN
    SET CLASSPATH=C:\PROGRA~1\CANONC~1\PHOTOD~1\ADOBEC~1;.;C:\J2SDK1.3.1_02\lib\tools.jar
    I have struggled with this for several weeks. I have also checked numerous online resources. any help would be appreciated.
    Thanks,
    Jeff

    Well, that's what is wrong! Change the
    C:\J2SDK1.3.1_02\BIN to C:\JDK1.3.1\bin
    Kamranyes, that is what was wrong. I should have used jdk1.3.1. I had tried that before but tried adding version #'s like 1.3.1_02.
    The initial java kit I downloaded says j2sdk1.3.1_02 on the winzip file, yet it extracted to a folder called jdk1.3.1, which is the one I should have used in the first place .
    Now that I have the dos prompt working , I will go and use ForteCE. lol. Thanks for you insight.
    Jeff

  • "Error running javac.exe compiler" when using ant to compile Eclipse plugin

    Hi
    I encounter an error "Error running C:\jdk1.5.0_06\bin\javac.exe compiler" when building my project using ant1.7.
    My project has 10 eclipse plugins, and each plugin is compiled by invoking following ant target
    <!-- ===================================================================
    Compile specified plugin
         target parameters:
              param.plugin.dir: the plugin directory
              param.plugin.targetJarFile: the name of jar file for the given plugin
              param.plugin.src.dir: the folder name of source codes. Note: it is relative path name
              param.fork: indicate if another process is forked to run javac
    =================================================================== -->
    <target name="compilePlugin">
         <!-- Prepare compile environment -->
         <!-- Delete obsolete build folder -->
         <delete dir="${param.plugin.dir}/${build.dir}" quiet="true"/>
         <!-- Delete obsolete jar file -->
         <delete file="${param.plugin.dir}/${param.plugin.targetJarFile}" quiet="true"/>
         <mkdir dir="${param.plugin.dir}/${build.dir}"/>
         <!-- Compile source codes -->
         <javac      srcdir="${param.plugin.dir}/${param.plugin.src.dir}"
                   destdir="${param.plugin.dir}/${build.dir}"
                   failonerror="${javacFailOnError}"
                   verbose="${javacVerbose}"
                   debug="${javacDebugInfo}"
                   deprecation="${javacDeprecation}"
              optimize="${javacOptimize}"
                   source="${javacSource}"
                   target="${javacTarget}"     
                   fork="${param.fork}" memoryInitialSize="256m" memoryMaximumSize="512m">
              <classpath refid="compile.classpath" />
         </javac>
         <!-- Create plugin jar file -->
         <copy todir="${param.plugin.dir}/${build.dir}" failonerror="true">
              <fileset dir="${param.plugin.dir}/${param.plugin.src.dir}" excludes="**/*.java, **/package.htm*" />
         </copy>
         <jar jarfile="${param.plugin.dir}/${param.plugin.targetJarFile}" basedir="${param.plugin.dir}/${build.dir}"/>
         <delete dir="${param.plugin.dir}/${build.dir}" quiet="true"/>
    </target>
    Since each of first 9 plugins contains less than 500 java source files, we always set "param.fork" to false when invoking this ant target.
    For the 10th plugin, it has about 1000 source files. If we set "param.fork" to false, we will get the error "Error running javac.exe compiler". So we have to set "param.fork" to true when compiling it. This week, this plugin contains about 1250 files and we get the same error again when compiling it. I tried to increase the "memoryMaximumSize" to "768", but still couldn't get through it.
    BTW, There are about 150 jar files in our classpath for compiling plugins. Do many jar files cause this problem?
    Any help is highly appreciated.
    Many thanks
    Oceanman

    I encountered a very similar error and I was able to resolve it by removing the following parameters from the javac task:
    fork="${param.fork}"
    memoryInitialSize="256m"
    memoryMaximumSize="512m"My values were not the same as yours, before I removed them, the values were set to:
    fork="true"
    memoryInitialSize="256m"
    memoryMaximumSize="256m" Not sure why this fixed my problem but it did. I was using Ant 1.7 and Java 1.6_07 hope this helps.

  • Javac.exe 1.4 is not finding user classes!!

    ! HELP !
    Okay, I've used -classpath, i've messed around a bit with my settings, but for some reason, I can't get java to compile my code on my machine!!! I know it works, because I made and compiled it on machines on my school's account.
    THE problem:
    javac.exe keeps telling me that all of my own class objects are unresolved symbols, yet they ALL exist! and they are in the same directory! This happens with any outside class object reference in any class except Sun's predefined SDKs.
    What the heck do I do?

    well well... Am I under the stupidly mistaken impression that the Platform kit is not the same as the Software Development kit?
    I think I am...I am going to download the 1.31a sdk, and if it works, then I'm going to slap myself. hard. REALLY hard. :) GRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRack!ACKACKACKACKACKACKACKACKACKACKACKACK!

  • Calling back c++ method in an exe (not a dll) from java?

    Hi all,
    I have to make an hybrid C++/java from an existing C++
    application that compiled is a big single exe not a dll.
    I'm running under win32.
    The application consists of several windows. The hybrid
    will have widows in C++ and some in java. They have the
    same menu and tool bar. In the C++, there are some
    callbacks called when a button is pressed. How to call
    these callback from java given the fact that the JVM and
    the java classes are launched by the exe file.
    I know how, from C++, start JVM and call my java window.
    I also know how to call a C++ method that is in a dll from
    java. It's from the tutorial
    http://java.sun.com/docs/books/tutorial/native1.1/index.html
    But I don't know how to call a C++ method that is in in an
    exe which has launch a JVM from an object running in this
    JVM.
    Is there somewhere an example like this?
    Thanks,
    Xavier.

    Thanks this helped.
    For those who want a complete example, here it is:
    Tested on XP, java 1.4.2, VC++ 6.0.
    ************ File invoke.cpp *****************************
    #include <stdlib.h>
    #include <jni.h>
    #ifdef _WIN32
    #define PATH_SEPARATOR ';'
    #else /* UNIX */
    #define PATH_SEPARATOR ':'
    #endif
    #define USER_CLASSPATH "." /* where Prog.class is */
    void JNICALL displayHelloWorld(JNIEnv *env, jobject obj)
        printf("Hello world: made by printf from C++\n");
        return;
    void main() {
        JNIEnv *env;
        JavaVM *jvm;
        JavaVMInitArgs vm_args;
        jint res;
        jclass cls;
        jmethodID mid;
        jstring jstr;
        jobjectArray args;
        char classpath[1024];
         int result;
        /* IMPORTANT: specify vm_args version # if you use JDK1.1.2 and beyond */
         JavaVMOption options[3];
         options[0].optionString = "-verbose:gc";
         sprintf (classpath, "-Djava.class.path=%s", USER_CLASSPATH);
         options[1].optionString = classpath;
         options[2].optionString = "-Djava.compiler=NONE";
         vm_args.options = options;
         vm_args.nOptions = 3;
         vm_args.ignoreUnrecognized = JNI_TRUE;
            vm_args.version = JNI_VERSION_1_4;
         /* IMPORTANT: Note that in the Java 2 SDK, there is no longer any need to call
          * JNI_GetDefaultJavaVMInitArgs. It causes a bug
        /* Append USER_CLASSPATH to the end of default system class path */
        /* Create the Java VM */
        res = JNI_CreateJavaVM(&jvm,(void**)&env, &vm_args);
        if (res < 0) {
            fprintf(stderr, "Can't create Java VM\n");
            exit(1);
        cls = env->FindClass("mypackage/Prog");
        if (cls == 0) {
            fprintf(stderr, "Can't find mypackage/Prog class\n");
            exit(1);
       JNINativeMethod nm;
       nm.name = "displayHelloWorld";
       /* method descriptor assigned to signature field */
       nm.signature = "()V";
       nm.fnPtr = displayHelloWorld;
       env->RegisterNatives(cls, &nm, 1);
        mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
        if (mid == 0) {
            fprintf(stderr, "Can't find Prog.main\n");
            exit(1);
        jstr = env->NewStringUTF(" from C++! calleded by C++, using argument from C++ but java method");
        if (jstr == 0) {
            fprintf(stderr, "Out of memory\n");
            exit(1);
        args = env->NewObjectArray(1,
                            env->FindClass("java/lang/String"), jstr);
        if (args == 0) {
            fprintf(stderr, "Out of memory\n");
            exit(1);
        env->CallStaticVoidMethod(cls, mid, args);
        jvm->DestroyJavaVM();
    }********************* File ./mypackage/Prog.java **************************
    package mypackage;
    public class Prog {
           public native void displayHelloWorld();
        public static void main(String[] args) {
            System.out.println("Hello World" + args[0] +"\n");
            Prog prog = new Prog();
            prog.displayHelloWorld();
            System.out.println("(called from java)");
            System.out.println("\nSo to sumurize:");
            System.out.println(" -1 Starting point is an exe (not DLL, there is no DLL) so C++ code");
            System.out.println(" -2 From C++ call java method using argument from C++");
            System.out.println(" -3 From java, that was launched by the exe, call to");
            System.out.println("    a native using the RegisterNatives in C++\n");
            System.out.println("You got a bidirectional example with as starting point");
            System.out.println("a single exe, launching JVM, loading class call back C++!");
    }******************* Command line for all ****************************************
    javac mypackage/Prog
    cl -I"D:\Program Files\j2sdk1.4.2_03\include" -I"D:\Program Files\j2sdk1.4.2_03\include\win32" -MT
    invoke.cpp -link D:\PROGRA~1\j2sdk1.4.2_03\lib\jvm.lib
    (Remark, the last path is using the short name for "Program Files" because with the blank
    even adding double quotes result into an error)
    You must have jvm.dll in your path for me it's Path=D:\Program Files\j2sdk1.4.2_03\jre\bin\client;
    Then simply call invoke and see the result. :-)

  • Error initializing ejb-module; Exception javac.exe not found under

    Dear all,
    I got followings error after i had tried to doing some lab.I had checked the folder "C:\Program Files\Oracle\jre\1.3.1" exists but missed but missing javac.exe. Could anyone can advice me what is going wrong?
    04/04/14 16:44:20 Auto-deploying - web/WEB-INF/classes (No previous deployment found)...
    04/04/14 16:44:20 Error instantiating application 'lab04' at file:/C:/share/oc4j
    /labs/lab04/: Error initializing ejb-module; Exception javac.exe not found under
    C:\Program Files\Oracle\jre\1.3.1, please use a valid jdk or specify the locati
    on of your java compiler in server.xml using the <java-compiler .../> tag
    Thanks in advance!
    Best Regards,
    Chris CHIU

    Dear Chris,
    The answer lies in the error message you got, namely:
    please use a valid jdkAccording to your post, you don't have a JDK, you only have a JRE. The javac compiler is part of the JDK, it is not part of the JRE.
    You can download the JDK from the J2SE Download Web page. Look for the Download J2SE SDK link -- do not choose the Download J2SE JRE link!
    Good Luck,
    Avi.

  • Error during java.exe, javac.exe,etc... execution

    Hi,
    I recently installed JSK1.2.1 on a PC with windows 2000.
    I correctly configured the PATH and CLASSPATH.
    When i compile or try to run java.exe, the system returns the following error in a window:
    "javac.exe has generated errors and will be closed by windows. You will need to restart he program.
    An error log is being created."
    The execution in the dos window stops as if nothing has happenned but the compilation doesn't work.
    What can be the problem?

    Does anyone have an answer to this problem. I am experiencing the same problem trying to use jdk1.1.6 (I know it's old but the contract I'm working on is forcing me to use it). I have done everything possible with the PATH and CLASSPATH. Still, nothing works.

  • RFE: faster javac compilation using invocation instead of running javac.exe

    Sun's JDK contains the Java compiler in tools.jar.
    Why not use it instead of running javac.exe?
    It should also simplify the code for cross platform compatibility...
    Regards,
    Yaniv Kunda

    I meant that JDev would invoke the compiler from the libs of the project JDK.
    But this is indeed a sort of a hack because the libs are not documented and are sun-specific (a problem with other JDKs).
    Anyway, I was just reading a bit on Java 6 (Mustang) and saw that an API (per JSR-199 : http://jcp.org/en/jsr/detail?id=199) for java compilation is one of its new features!
    This feature is documented in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4164450.
    I guess it would be a feature for a newer major release of JDev, but nevertheless important to mention.
    Regards,
    Yaniv Kunda

  • How to increase heap size in java code, not using "java -Xms64m "

    Im writing a java programme for loading the german dictionary. my dictionary is very huge(around 300000+ words).
    while loading the dictioanry im getting error "OutOfMemoryError" .
    I found one solution to increase the heap size, but i want to increase the heap size in java programmer itself, not outside jar file. so i could not use "-Xms64m" option of jvm.
    Can anyone tell me how can i do this

    sunlover1984 wrote:
    Im writing a java programme for loading the german dictionary. my dictionary is very huge(around 300000+ words).
    while loading the dictioanry im getting error "OutOfMemoryError" .
    I found one solution to increase the heap size, but i want to increase the heap size in java programmer itself, not outside jar file. so i could not use "-Xms64m" option of jvm.
    Can anyone tell me how can i do thisThat option is a startup option for the JVM. That means if your jar is already loaded then you are already too late to try and call it.

  • Exception thrown while using JCo in Java agents  in Lotus Domino applns.

    I am trying to use JCo in Java agents in a lotus domino application.  Here is my code:(This Java agent calls a Remote enabled function module in SAP which gives the sum of two given numbers)
    import lotus.domino.*;
    import java.util.*;
    import java.io.*;
    import com.sap.mw.jco.*;
    public class JavaAgent extends AgentBase
    private static JCO.Client jClient;
    public JCO.Client getJCOClient(String poolName) throws IOException, JCO.Exception
           System.out.println("Inside getJCOClient method");          
           System.out.println("Pool Name : "+ poolName);  
              boolean poolExists = false;     
          JCO.PoolManager poolManager  = JCO.PoolManager.singleton();
           String poolNames[] = poolManager.getPoolNames();
          // To check whether the given pool name already exists     
         if(poolNames != null)
                for(int poolIter = 0;poolIter<poolNames.length;poolIter++)
                 if(poolNames[poolIter].equals(poolName))
                        System.out.println("POOL ID =====>> "+poolName);
                        System.out.println("POOL NAMES["+ poolIter "] ========>>"poolNames[poolIter]);
                        poolExists = true;
                        break;
         String s = String.valueOf( poolExists );
          System.out.println("pool Exists :" + s );     
          if(poolExists == false)
               try
                   int maxConnections = 50;
                   String JCOClient = "111";
                   String user = "apabap4";
                   String password = "sap123";
                   String language = "en";
                   String ashost = "172.25.10.68";
                   String sysnr = "00";
                   //To create an instance of a client pool to the remote SAP system
                   System.out.println("Before addClientPool");
                   System.out.println("Pool Name : " + poolName);
                   JCO.addClientPool(poolName,maxConnections,JCOClient,user,password,language,ashost,sysnr);
              //     JCO.createClient(JCOClient, user,password,language, "172.25.10.68");
                   System.out.println("New Connection Pool Created");
               catch(JCO.Exception jcoe)
                    throw new JCO.Exception(jcoe.getGroup(),jcoe.getKey(),"Error in client pool creation "+jcoe.toString());
         try
                  //getClient() method returns a client connection from the specified spool     
                   jClient = JCO.getClient(poolName);
         catch(JCO.Exception jcoe1)
                   throw new JCO.Exception(jcoe1.getGroup(),jcoe1.getKey(),"Error in getting JCO client "+jcoe1.toString());
              return jClient;
         // End of method getJCOClient()     
         public void releaseJCOClient() throws JCO.Exception
          try
                   JCO.releaseClient(jClient);
         catch(JCO.Exception jcoe2)
                   throw new JCO.Exception(jcoe2.getGroup(),jcoe2.getKey(),"Error in releasing client "+jcoe2.toString());
    public void NotesMain()
              try {
                   Session session = getSession();
                   AgentContext agentContext = session.getAgentContext();
                  Document doc = agentContext.getDocumentContext();
       JavaAgent jcoObj = new JavaAgent();
       JCO.Client jClient = null;
       String poolId = new String("EG_POOL");
       IFunctionTemplate   ifun;//For function object
       JCO.Function func;          
       JCO.ParameterList importParams,exportParams,tableParams;
       try{
             jClient = jcoObj.getJCOClient(poolId);
           System.out.println("After Getting Connection");
           System.out.println("Attributes:" + jClient.getAttributes());
            //Create a repository object
            JCO.Repository mRepository = new JCO.Repository("myJCO_REPOSITORY", jClient);
            //Creating a function object
            ifun = mRepository.getFunctionTemplate("ZSUM");// The Function Name
           func = ifun.getFunction();
            System.out.println("Function name " + func.getName());
            //To get the import parameters in the function module
            importParams = func.getImportParameterList();
            System.out.println("Import parameters"+ importParams);
            importParams.appendValue("OPERAND1",importParams.TYPE_INT,4,"25");
           importParams.appendValue("OPERAND2",importParams.TYPE_INT,4,"25");
            jClient.execute(func);//Executing the function 
            //To get the export parameters in the function module
            exportParams = func.getExportParameterList();
               System.out.println("Export parameters" + exportParams);
            int sumVl = exportParams.getInt("SUM");
            Integer sumValue = new Integer(sumVl);
            System.out.println("Sum Value" + sumValue);
             doc.replaceItemValue("txtSum", sumValue.toString());
            //releaseJCOClient();
      catch(IOException ioe)
          ioe.printStackTrace();
      catch(JCO.Exception jcoe1)
          jcoe1.printStackTrace();
              } catch(Exception e) {
                   e.printStackTrace();
    While executing this agent I am getting the following exception.
    08/25/2004 06:27:45 PM  HTTP JVM: java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'  Native Library C:\Lotus\Domino\sapjcorfc.dll already loaded in another classloader
    08/25/2004 06:27:45 PM  HTTP JVM:  at com.sap.mw.jco.JCO.<clinit>(Unknown Source)
    08/25/2004 06:27:45 PM  HTTP JVM:  at JCoCallTrans.getJCOClient(JCoCallTrans.java:42)
    08/25/2004 06:27:45 PM  HTTP JVM:  at JCoCallTrans.NotesMain(JCoCallTrans.java:88)
    08/25/2004 06:27:45 PM  HTTP JVM:  at lotus.domino.AgentBase.runNotes(Unknown Source)
    08/25/2004 06:27:45 PM  HTTP JVM:  at lotus.domino.NotesThread.run(NotesThread.java:208)
    08/25/2004 06:27:45 PM  HTTP JVM: Error cleaning up agent threads
    Also I have placed the jco.jar in lib of jvm in Domino directory i.e.,
    Lotus\Domino\jvm\lib and
    sapjcorfc.dll and librfc32.dll in system32 of WINNT folder.
    Kindly help me to rectify this problem
    Arokiaraj.S

    I had approximate the same problem, and I've fixed it. In my jar file the javaHelpSearch Folder was named with a leading lower case "j". But in my helpset.hs it was with an upper Case "J"
    <name>Search</name>
        <label>Search</label>
        <type>javax.help.SearchView</type>
        <data engine="com.sun.java.help.search.DefaultSearchEngine">JavaHelpSearch</data>
       </view>When the helpset is called from a folder: windows ignore it, but when the helpset is called from into a jar you must type it correct!

Maybe you are looking for

  • Problem with Rebate agreement

    We have a problem with Rebate agreement settlement. Generally when the finall settlement of Rebate is completed ( with status D - D means final settlement ), the liability should be zero. However, after we made final settlement, still some amount is

  • Captivate 6.0 does not open linked PDF correctly

    Hi everyone We have Captivate 6.0.0.199 and are creating a project that will be delivered OFFLINE (either as html or as exe). Within the project there is a button that links to an external PDF file. Result: When launching the published project, the P

  • Why will imovie not accept pictures that i want to add to my project

    Whenever I try and add photos to my imovie project imovie will not accept them. When i drag and try to drop them in the place id like to place them the incert section turns green as if imovie recongnizes where i want to place the picture but the pict

  • Virtual Machine with Adobe Pro 8 Unable to activate.

    I had a physical machine with windows 2K3 and Adobe Pro 8. We ported the physical machine to a virtual machine and now Adobe Pro 8 says it needs to activate again. We tried to activate through the web and over the phone, but we are currently out of a

  • How to add total of actual in My work- Task in project server 2010.

    Hello all,  I need to add total of actual in My work->Task in project server 2010. How can I achieve it? Your help is appreciated.