Launching jvm in solaris from java...

I have a problem launching jvm from java in solaris...
java.io.IOException: "/opt/XX/YY/jre/bin/java": not found
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
But when I give /opt/XX/YY/jre/bin/java from my console it's working fine...
what could be the problem ?? (I mean the path is correct..)
Message was edited by:
chaos_begins_here

When I try to System.exec() a program that doesn't exist, I get the following:
java.io.IOException: foo: not found
Note that foo (the program I tried to exec) is not in quotes. Check the strings you are passing to exec() to make sure there are no extra quotes. It's possible the difference in format is due to different java versions, but the point is to sanity check the strings you're passing.

Similar Messages

  • Launching command containing pipe from Java

    Hi,
    i have some troubles to launch a command containing pipe from java.
    I've tried to backslash the pipe but it still not work.
    Maybe someone has an idea about that :
    head -102050 /data/a_very_big_file | tail -5
    the idea is to get 5 lines in the middle of a very big file.
    To launch commands from java i use i think the classical way,
    something like :
    Process p = Runtime.getRuntime().exec(commande[0], this.envp, new File(this.pathExecution));
    I obtain this error :
    ERROR : head: invalid option -- 5
    ERROR : Try `head --help' for more information.
    Thanks for your help,
    kevin.

    kevleb wrote:
    yes same result...
    but i think the problem come from the fact
    that when you pipe your result of a command,
    you launch an other process (is that true).i don't know if another process is launched (the probability is rather high, though)
    but even if that's the case, from the time you rely on a shell and not directly on exec(), i think it shouldn't be a problem to include a | inside the command ; i don't have an idea why it gives you that message error :\

  • Using KNI to launch a c program from java

    Here's my env: Garmin iQue 3600 running Palm OS 5, with iQue GPS installed. I've downloaded the most current cldc/midp packages.
    I'm modifying a j2me inventory app which needs to access a GPS library (in C) to suck lat/long values into the j2me app.
    How do you use KNI to load the needed library? I don't see a method in the System or Runtime classes of the KVM such as System.loadLibrary("nativelib") in JNI.
    Any help from someone who has done this would be greatly appreciated. This is my first app on a handheld, and I must be missing something?!

    Hi Harshad,
    I have a possible solution, but haven't had the time to do a proof-of-concept yet (working on another app now).
    I want to use CDC/Foundation Profile/Other Profiles as needed instead of CLDC/MIDP. The CDC has the full System class, with JNI functionality. I'd write a small library in C which is JNI aware, and able to call the native C library for the lat/long values my app needs.
    I should be able to load my C library from my app using System.loadLibrary() and invoke a native method I write to bridge the gap to the native method I need. My client device has lots of RAM and processor speed, so I think it would work.
    I was told that http://www.superwaba.com.br/en/default.asp these people also have a "VM" that contains JNI functionality, but haven't looked at it yet.

  • Problems running external Win32 Multithread C-Program from Java

    hi,
    i just wrote a little java application which is calling my c-binary (a win32 multithread application written in pure ansi c) . let's call it "test.exe". i'm launching it via:
    Runtime.getRuntime().exec(cmd, new String[] { env }, dir)the program is started correctly and i get all test.exe outputs on my java console (therefor i grabbed the inputstream and errorstream of the process-object ...). so far so good.
    my problem is, that something with the multithreading seems to be wrong, when launching my test.exe from java!
    for example, i have the following line of code in my c-program (test.exe):
    WaitForSingleObject( g_hMutexREADY, INFINITE );if i launch my program as java process, this line seems to be ignored! that means, the program doesn't stop executing at this point (and is waiting for the mutex) but simply continues executing, causing the whole program to crash.
    if i run the same program directly from the winxp commandline all is working fine (that means: the threads of 'test.exe' synchronize each other correctly via the mutexes)!
    does anybody has an idea or have already had similar problems? maybe some win32 libraries are missing, could that be?
    thanks a lot.
    k4simir

    I just debugged a little bit through my c program. and it's not the multithrading stuff causing the error, but the win32 socket creation!
    my "multithreading c program" :-) is an ASR (automatic speech recognizer). it runs as socket server (on localhost) and accepts connections from clients (my java application). the client (java app) controls the ASR server (means start(), stop(), open(), close() ...). if the ASR server recognizes some user input, it will transfer it to the client for further processing.
    so far the theory. if i launch the ASR server via the window command line, the communication and the other stuff works fine. now i want my java app to launch the ASR server.
    the ASR fails, when it tries to create the socket:
    g_Vars.kServSock = socket( AF_INET, SOCK_STREAM, 0 );the error code returned by WSAGetLastError() is 10106! i didn't find this error code in the msdn! so i don't know what it means or what might be the problem.
    any ideas?
    thanks a lot!
    k4simir
    here's the full code:
    int     InitSocket( short sPortNr ) {
         int               iErr;
         SOCKADDR_IN     kMyAddr;
         iErr = StartUp();
         if( iErr != _SRC_OK ) {
              return _SRC_ERROR;
         // create server-socket:
         g_Vars.kServSock = socket( AF_INET, SOCK_STREAM, 0 );
         if( g_Vars.kServSock == INVALID_SOCKET ) {
              CleanUp();
              return _SRC_ERROR;
    int StartUp() {
         WORD wVersionRequested;
         WSADATA wsaData;
         int err;
         _DEBUGPRINT
         wVersionRequested = MAKEWORD( 2, 2 );
         err = WSAStartup( wVersionRequested, &wsaData );
         if ( err != 0 ) {
              return _SRC_ERROR;
         if ( LOBYTE( wsaData.wVersion ) != 2 ||
               HIBYTE( wsaData.wVersion ) != 2 ) {
              WSACleanup( );
              return _SRC_ERROR;
         return _SRC_OK;
    }

  • Launching Browser from Java when Browser URL is very  long

    Hi,
    I am trying to launch a browser from Java.
    I am doing the following.
    String command = "cmd" + "/c" + "start" + " browserURL";
    Process p = Runtime.getRuntime()exec(command);
    Note: My browserURL is very long.
    Now the browser is invoked. But the URL shown is incomplete and hence
    browser is unable to open the required application.
    Can someone help me in this.
    One way is to increase the buffer size on the command prompt?
    Is there any java command for this?
    Is there any other way to solve this issue.
    Thanks,
    AR

    this is my second time posting this, take note of it. I can't remember where i got it from, but credits go to the person that wrote it. It has helped me out thousands of times!!!
    to use, compile, then call from your program:
    org.newio.utils.BrowserLauncher.openURL("your url here")dfwtc
    package org.newio.utils;
    import java.io.File;
    import java.io.IOException;
    import java.lang.reflect.*;
    public class BrowserLauncher
        private static int jvm;
        private static Object browser;
        private static boolean loadedWithoutErrors;
        private static Class mrjFileUtilsClass;
        private static Class mrjOSTypeClass;
        private static Class macOSErrorClass;
        private static Class aeDescClass;
        private static Constructor aeTargetConstructor;
        private static Constructor appleEventConstructor;
        private static Constructor aeDescConstructor;
        private static Method findFolder;
        private static Method getFileType;
        private static Method makeOSType;
        private static Method putParameter;
        private static Method sendNoReply;
        private static Object kSystemFolderType;
        private static Integer keyDirectObject;
        private static Integer kAutoGenerateReturnID;
        private static Integer kAnyTransactionID;
        private static final int MRJ_2_0 = 0;
        private static final int MRJ_2_1 = 1;
        private static final int WINDOWS_NT = 2;
        private static final int WINDOWS_9x = 3;
        private static final int OTHER = -1;
        private static final String FINDER_TYPE = "FNDR";
        private static final String FINDER_CREATOR = "MACS";
        private static final String GURL_EVENT = "GURL";
        private static final String FIRST_WINDOWS_PARAMETER = "/c";
        private static final String SECOND_WINDOWS_PARAMETER = "start";
        private static final String NETSCAPE_OPEN_PARAMETER_START = " -remote 'openURL(";
        private static final String NETSCAPE_OPEN_PARAMETER_END = ")'";
        private static String errorMessage;
        private BrowserLauncher()
        private static boolean loadClasses()
            switch(jvm)
            default:
                break;
            case 0: // '\0'
                try
                    Class aeTargetClass = Class.forName("com.apple.MacOS.AETarget");
                    macOSErrorClass = Class.forName("com.apple.MacOS.MacOSError");
                    Class osUtilsClass = Class.forName("com.apple.MacOS.OSUtils");
                    Class appleEventClass = Class.forName("com.apple.MacOS.AppleEvent");
                    Class aeClass = Class.forName("com.apple.MacOS.ae");
                    aeDescClass = Class.forName("com.apple.MacOS.AEDesc");
                    aeTargetConstructor = aeTargetClass.getDeclaredConstructor(new Class[] {
                        Integer.TYPE
                    appleEventConstructor = appleEventClass.getDeclaredConstructor(new Class[] {
                        Integer.TYPE, Integer.TYPE, aeTargetClass, Integer.TYPE, Integer.TYPE
                    aeDescConstructor = aeDescClass.getDeclaredConstructor(new Class[] {
                        java.lang.String.class
                    makeOSType = osUtilsClass.getDeclaredMethod("makeOSType", new Class[] {
                        java.lang.String.class
                    putParameter = appleEventClass.getDeclaredMethod("putParameter", new Class[] {
                        Integer.TYPE, aeDescClass
                    sendNoReply = appleEventClass.getDeclaredMethod("sendNoReply", new Class[0]);
                    Field keyDirectObjectField = aeClass.getDeclaredField("keyDirectObject");
                    keyDirectObject = (Integer)keyDirectObjectField.get(null);
                    Field autoGenerateReturnIDField = appleEventClass.getDeclaredField("kAutoGenerateReturnID");
                    kAutoGenerateReturnID = (Integer)autoGenerateReturnIDField.get(null);
                    Field anyTransactionIDField = appleEventClass.getDeclaredField("kAnyTransactionID");
                    kAnyTransactionID = (Integer)anyTransactionIDField.get(null);
                    break;
                catch(ClassNotFoundException cnfe)
                    errorMessage = cnfe.getMessage();
                    return false;
                catch(NoSuchMethodException nsme)
                    errorMessage = nsme.getMessage();
                    return false;
                catch(NoSuchFieldException nsfe)
                    errorMessage = nsfe.getMessage();
                    return false;
                catch(IllegalAccessException iae)
                    errorMessage = iae.getMessage();
                return false;
            case 1: // '\001'
                try
                    mrjFileUtilsClass = Class.forName("com.apple.mrj.MRJFileUtils");
                    mrjOSTypeClass = Class.forName("com.apple.mrj.MRJOSType");
                    Field systemFolderField = mrjFileUtilsClass.getDeclaredField("kSystemFolderType");
                    kSystemFolderType = systemFolderField.get(null);
                    findFolder = mrjFileUtilsClass.getDeclaredMethod("findFolder", new Class[] {
                        mrjOSTypeClass
                    getFileType = mrjFileUtilsClass.getDeclaredMethod("getFileType", new Class[] {
                        java.io.File.class
                    break;
                catch(ClassNotFoundException cnfe)
                    errorMessage = cnfe.getMessage();
                    return false;
                catch(NoSuchFieldException nsfe)
                    errorMessage = nsfe.getMessage();
                    return false;
                catch(NoSuchMethodException nsme)
                    errorMessage = nsme.getMessage();
                    return false;
                catch(SecurityException se)
                    errorMessage = se.getMessage();
                    return false;
                catch(IllegalAccessException iae)
                    errorMessage = iae.getMessage();
                return false;
            return true;
        private static Object locateBrowser()
            if(browser != null)
                return browser;
            switch(jvm)
            case 0: // '\0'
                try
                    Integer finderCreatorCode = (Integer)makeOSType.invoke(null, new Object[] {
                        "MACS"
                    Object aeTarget = aeTargetConstructor.newInstance(new Object[] {
                        finderCreatorCode
                    Integer gurlType = (Integer)makeOSType.invoke(null, new Object[] {
                        "GURL"
                    Object appleEvent = appleEventConstructor.newInstance(new Object[] {
                        gurlType, gurlType, aeTarget, kAutoGenerateReturnID, kAnyTransactionID
                    return appleEvent;
                catch(IllegalAccessException iae)
                    browser = null;
                    errorMessage = iae.getMessage();
                    return browser;
                catch(InstantiationException ie)
                    browser = null;
                    errorMessage = ie.getMessage();
                    return browser;
                catch(InvocationTargetException ite)
                    browser = null;
                    errorMessage = ite.getMessage();
                    return browser;
            case 1: // '\001'
                File systemFolder;
                try
                    systemFolder = (File)findFolder.invoke(null, new Object[] {
                        kSystemFolderType
                catch(IllegalArgumentException iare)
                    browser = null;
                    errorMessage = iare.getMessage();
                    return browser;
                catch(IllegalAccessException iae)
                    browser = null;
                    errorMessage = iae.getMessage();
                    return browser;
                catch(InvocationTargetException ite)
                    browser = null;
                    errorMessage = ite.getTargetException().getClass() + ": " + ite.getTargetException().getMessage();
                    return browser;
                String systemFolderFiles[] = systemFolder.list();
                for(int i = 0; i < systemFolderFiles.length; i++)
                    try
                        File file = new File(systemFolder, systemFolderFiles);
    if(file.isFile())
    Object fileType = getFileType.invoke(null, new Object[] {
    file
    if("FNDR".equals(fileType.toString()))
    browser = file.toString();
    return browser;
    catch(IllegalArgumentException iare)
    browser = browser;
    errorMessage = iare.getMessage();
    return null;
    catch(IllegalAccessException iae)
    browser = null;
    errorMessage = iae.getMessage();
    return browser;
    catch(InvocationTargetException ite)
    browser = null;
    errorMessage = ite.getTargetException().getClass() + ": " + ite.getTargetException().getMessage();
    return browser;
    browser = null;
    break;
    case 2: // '\002'
    browser = "cmd.exe";
    break;
    case 3: // '\003'
    browser = "command.com";
    break;
    case -1:
    default:
    browser = "netscape";
    break;
    return browser;
    public static void openURL(String url)
    throws IOException
    if(!loadedWithoutErrors)
    throw new IOException("Exception in finding browser: " + errorMessage);
    Object browser = locateBrowser();
    if(browser == null)
    throw new IOException("Unable to locate browser: " + errorMessage);
    switch(jvm)
    case 0: // '\0'
    Object aeDesc = null;
    try
    try
    aeDesc = aeDescConstructor.newInstance(new Object[] {
    url
    putParameter.invoke(browser, new Object[] {
    keyDirectObject, aeDesc
    sendNoReply.invoke(browser, new Object[0]);
    catch(InvocationTargetException ite)
    throw new IOException("InvocationTargetException while creating AEDesc: " + ite.getMessage());
    catch(IllegalAccessException iae)
    throw new IOException("IllegalAccessException while building AppleEvent: " + iae.getMessage());
    catch(InstantiationException ie)
    throw new IOException("InstantiationException while creating AEDesc: " + ie.getMessage());
    break;
    finally
    aeDesc = null;
    browser = null;
    case 1: // '\001'
    Runtime.getRuntime().exec(new String[] {
    (String)browser, url
    break;
    case 2: // '\002'
    case 3: // '\003'
    Runtime.getRuntime().exec(new String[] {
    (String)browser, "/c", "start", url
    break;
    case -1:
    Process process = Runtime.getRuntime().exec((String)browser + " -remote 'openURL(" + url + ")'");
    try
    int exitCode = process.waitFor();
    if(exitCode != 0)
    Runtime.getRuntime().exec(new String[] {
    (String)browser, url
    catch(InterruptedException ie)
    throw new IOException("InterruptedException while launching browser: " + ie.getMessage());
    break;
    default:
    Runtime.getRuntime().exec(new String[] {
    (String)browser, url
    break;
    static
    loadedWithoutErrors = true;
    String osName = System.getProperty("os.name");
    if("Mac OS".equals(osName))
    String mrjVersion = System.getProperty("mrj.version");
    String majorMRJVersion = mrjVersion.substring(0, 3);
    try
    double version = Double.valueOf(majorMRJVersion).doubleValue();
    if(version == 2D)
    jvm = 0;
    } else
    if(version >= 2.1000000000000001D)
    jvm = 1;
    } else
    loadedWithoutErrors = false;
    errorMessage = "Unsupported MRJ version: " + version;
    catch(NumberFormatException numberformatexception)
    loadedWithoutErrors = false;
    errorMessage = "Invalid MRJ version: " + mrjVersion;
    } else
    if(osName.startsWith("Windows"))
    if(osName.indexOf("9") != -1)
    jvm = 3;
    } else
    jvm = 2;
    } else
    jvm = -1;
    if(loadedWithoutErrors)
    loadedWithoutErrors = loadClasses();
    suck my balls

  • Problem calling two perl modules from java in seperate threads(JVM CRASHES)

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

  • Launching IE from Java

    Hi,
    My requirement is as follows:
    I must be able to launch Internet explorer from Java. Also i must be able to open a pdf file inside it (embedded inside IE i.e. acrobat reader inside IE).
    I have tried using OleControlSite object, but does not work ( i mean it does not launch IE). I have also tried using exec. Here, how do i open ? What are the parameters that need to be passed to exec? i have tried the following code.....
    String WIN_PATH = "rundll32";
    String WIN_FLAG = "url.dll,FileProtocolHandler";
    String cmd = WIN_PATH + " " + WIN_FLAG + " " + "c:\\NYSE Glossary.pdf";
    try {
    p = Runtime.getRuntime().exec(cmd);
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    This piece of code opens the pdf file in acrobat reader(stand-alone). But i want the file to be open inside IE(acrobat embedded inside IE).
    Can anyone suggest me a solution?
    Thanks and Regards,
    Kris

    i have done the same thing.. it just opens the pdfin
    acrobat reader.. not as part of IEThat has nothing to do with the code... you need to
    install Acrobat plugin in IE. :)Annie. Have you changed login?

  • Launch multiple WS apps from a local Java application?

    I should develop a local Java application that on demand launches webstart applications. Obviously it could be done with a simple HTML file, but the requirements are that launched apps be monitored by the launching app, so they need to be in the same JVM.
    I tried
    java -Djnlpx.home="C:/programfilesdir/Java Web Start"
    -classpath ".;..\classes;..\lib;..\lib\javaws.jar" Launcher
    Then Launcher.java calls com.sun.javaws.Main's main method passing the JNLP URL as a parameter.
    This launches Java Web Start and then the child app, but for some reason I ignore the Launcher app is exited without exceptions as soon as javaws starts.
    Provided that the Java WS app manager is itself a Java app that launches WS app's, any clue on how to do the same thing? Or can the source code be inspected?
    Thanks.

    I should develop a local Java application that on
    demand launches webstart applications. Obviously it
    could be done with a simple HTML file, but the
    requirements are that launched apps be monitored by
    the launching app, so they need to be in the same
    JVM.You might check out netx, a open-source JNLP client that has extra support for running multiple apps in a single JVM. It includes a SecurityManager that can catch System.exit and close the calling app's windows and resources (applet sounds, etc) instead of closing the JVM. It has other support too like separate look and feels for each app.
    It doesn't yet implement all of the spec though, but it does run most JNLP apps.
    http://jnlp.sourceforge.net/netx/

  • Easiest way to launch a link to the default browser from java?

    Is there an easy way to launch a link in the default browser from java? Ideally I would have a graphic in a cell that when clicked on would open a new window/tab in the default browser. This would be done in SWT, but it might be similar to swing, awt, etc. Any ideas?

    If you are using Java 1.5 or earlier, I found the browser launch code found here to work fairly well: http://www.centerkey.com/java/browser

  • Launching applications from java code

    I have found a solution to launch applications from java.I thought this will be useful for programmers who want to open a
    1. Browser
    2. Player
    3. Files etc.
    There are 2 solutions :
    I)To use a known application :
    eg: to open windows media player
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe";
    cmd[1] = "/C";
    cmd[2] = "START MPLAYER2.exe "+mediaURL+" /PLAY /CLOSE /FULLSCREEN";
    //eg: mediaURL = "\"D:/project/songs/track1.mp3\""
    // /PLAY /CLOSE /FULLSCREEN this option can be used only for windows media player
    // for any other application use cmd[2] as START apl.exe //apl can be any windows application
    Process p = Runtime.getRuntime().exec(cmd);
    II) To use a default application:
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
    // url can be any url
    ref: [http://forums.sun.com/thread.jspa?threadID=5203313|http://forums.sun.com/thread.jspa?threadID=5203313]
    [http://www.ericphelps.com/batch/rundll/|http://www.ericphelps.com/batch/rundll/]
    Edited by: veda_sishta on ? ?????, ???? ??:?? ???????
    Edited by: veda_sishta on ? ?????, ???? ??:?? ???????

    To post code, use the code tags -- [code]Your Code[/code] will display asYour CodeOr use the code button above the editing area and paste your code between the {code}{code} tags it generates.
    And make up your mind what file type you're having a problem with. Maybe .asx doesn't have a file association on your computer.
    This works just fine for .m3u:import java.awt.Desktop;
    import java.io.File;
    import java.io.IOException;
    public class Playlist {
       public static void main(String[] args) {
          try {
             Desktop.getDesktop().
                   open(new File("E:/Music/Playlists/test.m3u"));
          } catch (IOException ex) {
             ex.printStackTrace();
    }db
    edit Did you try searching the net for the error you got? ("Invalid menu handle")
    Edited by: Darryl.Burke

  • How can I use JVM  instructions from Java classes?

    Hello,
    I want to use JVM instructions in my Java classes. How can I achieve this?
    Should I include a library to my project or something else?

    What on earth are you talking about?

  • JVM Error while running java application through Java Webstart

    Hi All,
    While running java application through Webstart, we got the following error log and application is not running. I am not sure why this is happened? Can anyone help me out to resolve this problem?
    Help Regarding this will be highly appreciated.
    Thanks In advance.
    Bala
    Error in Log File:
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # Internal Error (53545542324F5554494E45530E435050008C), pid=684, tid=9424
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
    --------------- T H R E A D ---------------
    Current thread (0x00345a60): JavaThread [_thread_in_vm, id=9424]
    Stack: [0x00030000,0x00070000), sp=0x0006f9a4, free space=254k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [jvm.dll+0x12430d]
    V [jvm.dll+0x6366e]
    V [jvm.dll+0x636a3]
    V [jvm.dll+0x10073c]
    V [jvm.dll+0x7859b]
    V [jvm.dll+0x919fc]
    C [javaw.exe+0x2120]
    C [javaw.exe+0x11bb]
    C [javaw.exe+0x3151]
    C [kernel32.dll+0x123e5]
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    Other Threads:
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 2304K, used 42K [0x02a60000, 0x02cd0000, 0x051c0000)
    eden space 2112K, 2% used [0x02a60000, 0x02a6a908, 0x02c70000)
    from space 192K, 0% used [0x02c70000, 0x02c70000, 0x02ca0000)
    to space 192K, 0% used [0x02ca0000, 0x02ca0000, 0x02cd0000)
    tenured generation total 30272K, used 0K [0x051c0000, 0x06f50000, 0x22a60000)
    the space 30272K, 0% used [0x051c0000, 0x051c0000, 0x051c0200, 0x06f50000)
    compacting perm gen total 8192K, used 409K [0x22a60000, 0x23260000, 0x26a60000)
    the space 8192K, 4% used [0x22a60000, 0x22ac64d0, 0x22ac6600, 0x23260000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040d000 C:\Program Files\Java\jre1.5.0_11\bin\javaw.exe
    0x7c800000 - 0x7c8c0000 C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000 C:\WINDOWS\system32\kernel32.dll
    0x77f50000 - 0x77fec000 C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000 C:\WINDOWS\system32\RPCRT4.dll
    0x77380000 - 0x77412000 C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c48000 C:\WINDOWS\system32\GDI32.dll
    0x77ba0000 - 0x77bfa000 C:\WINDOWS\system32\MSVCRT.dll
    0x71c20000 - 0x71c32000 C:\WINDOWS\system32\tsappcmp.dll
    0x76290000 - 0x762ad000 C:\WINDOWS\system32\IMM32.DLL
    0x6d640000 - 0x6d7dd000 C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll
    0x76aa0000 - 0x76acd000 C:\WINDOWS\system32\WINMM.dll
    0x71bc0000 - 0x71bc8000 C:\WINDOWS\system32\rdpsnd.dll
    0x771f0000 - 0x77201000 C:\WINDOWS\system32\WINSTA.dll
    0x71c40000 - 0x71c98000 C:\WINDOWS\system32\NETAPI32.dll
    0x76b70000 - 0x76b7b000 C:\WINDOWS\system32\PSAPI.DLL
    0x6d290000 - 0x6d298000 C:\Program Files\Java\jre1.5.0_11\bin\hpi.dll
    0x6d610000 - 0x6d61c000 C:\Program Files\Java\jre1.5.0_11\bin\verify.dll
    0x6d310000 - 0x6d32d000 C:\Program Files\Java\jre1.5.0_11\bin\java.dll
    0x6d630000 - 0x6d63f000 C:\Program Files\Java\jre1.5.0_11\bin\zip.dll
    VM Arguments:
    jvm_args: -Xms32m -Xmx512m -Xbootclasspath/a:C:\Program Files\Java\jre1.5.0_11\lib\javaws.jar;C:\Program Files\Java\jre1.5.0_11\lib\deploy.jar -Djnlpx.home=C:\Program Files\Java\jre1.5.0_11\bin -Djnlpx.splashport=1970 -Djnlpx.jvm="C:\Program Files\Java\jre1.5.0_11\bin\javaw.exe" -Djnlpx.remove=true -Djava.security.policy=file:C:\Program Files\Java\jre1.5.0_11\lib\security\javaws.policy -DtrustProxy=true -Xverify:remote -Djnlpx.heapsize=32m,512m
    java_command: com.sun.javaws.Main C:\DOCUME~1\ssiwach\LOCALS~1\Temp\1\javaws3
    Launcher Type: SUN_STANDARD
    Environment Variables:
    PATH=C:\Program Files\Java\jre1.5.0_11\bin;D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\mysql\bin;"C:\Program Files\Java\jre1.5.0_11\bin"
    USERNAME=ssiwach
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows Server 2003 family Build 3790 Service Pack 1
    CPU:total 2 (cores per cpu 1, threads per core 2) family 15 model 4 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht
    Memory: 4k page, physical 2097151k(438060k free), swap 4194303k(5136k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_11-b03) for windows-x86, built on Dec 15 2006 01:16:12 by "java_re" with MS VC++ 6.0
    ------------------------------------------------------------------------------------------------------------------

    Hi All,
    While running java application through Webstart, we got the following error log and application is not running. I am not sure why this is happened? Can anyone help me out to resolve this problem?
    Help Regarding this will be highly appreciated.
    Thanks In advance.
    Bala
    Error in Log File:
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # Internal Error (53545542324F5554494E45530E435050008C), pid=684, tid=9424
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
    --------------- T H R E A D ---------------
    Current thread (0x00345a60): JavaThread [_thread_in_vm, id=9424]
    Stack: [0x00030000,0x00070000), sp=0x0006f9a4, free space=254k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [jvm.dll+0x12430d]
    V [jvm.dll+0x6366e]
    V [jvm.dll+0x636a3]
    V [jvm.dll+0x10073c]
    V [jvm.dll+0x7859b]
    V [jvm.dll+0x919fc]
    C [javaw.exe+0x2120]
    C [javaw.exe+0x11bb]
    C [javaw.exe+0x3151]
    C [kernel32.dll+0x123e5]
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    Other Threads:
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 2304K, used 42K [0x02a60000, 0x02cd0000, 0x051c0000)
    eden space 2112K, 2% used [0x02a60000, 0x02a6a908, 0x02c70000)
    from space 192K, 0% used [0x02c70000, 0x02c70000, 0x02ca0000)
    to space 192K, 0% used [0x02ca0000, 0x02ca0000, 0x02cd0000)
    tenured generation total 30272K, used 0K [0x051c0000, 0x06f50000, 0x22a60000)
    the space 30272K, 0% used [0x051c0000, 0x051c0000, 0x051c0200, 0x06f50000)
    compacting perm gen total 8192K, used 409K [0x22a60000, 0x23260000, 0x26a60000)
    the space 8192K, 4% used [0x22a60000, 0x22ac64d0, 0x22ac6600, 0x23260000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040d000 C:\Program Files\Java\jre1.5.0_11\bin\javaw.exe
    0x7c800000 - 0x7c8c0000 C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000 C:\WINDOWS\system32\kernel32.dll
    0x77f50000 - 0x77fec000 C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000 C:\WINDOWS\system32\RPCRT4.dll
    0x77380000 - 0x77412000 C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c48000 C:\WINDOWS\system32\GDI32.dll
    0x77ba0000 - 0x77bfa000 C:\WINDOWS\system32\MSVCRT.dll
    0x71c20000 - 0x71c32000 C:\WINDOWS\system32\tsappcmp.dll
    0x76290000 - 0x762ad000 C:\WINDOWS\system32\IMM32.DLL
    0x6d640000 - 0x6d7dd000 C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll
    0x76aa0000 - 0x76acd000 C:\WINDOWS\system32\WINMM.dll
    0x71bc0000 - 0x71bc8000 C:\WINDOWS\system32\rdpsnd.dll
    0x771f0000 - 0x77201000 C:\WINDOWS\system32\WINSTA.dll
    0x71c40000 - 0x71c98000 C:\WINDOWS\system32\NETAPI32.dll
    0x76b70000 - 0x76b7b000 C:\WINDOWS\system32\PSAPI.DLL
    0x6d290000 - 0x6d298000 C:\Program Files\Java\jre1.5.0_11\bin\hpi.dll
    0x6d610000 - 0x6d61c000 C:\Program Files\Java\jre1.5.0_11\bin\verify.dll
    0x6d310000 - 0x6d32d000 C:\Program Files\Java\jre1.5.0_11\bin\java.dll
    0x6d630000 - 0x6d63f000 C:\Program Files\Java\jre1.5.0_11\bin\zip.dll
    VM Arguments:
    jvm_args: -Xms32m -Xmx512m -Xbootclasspath/a:C:\Program Files\Java\jre1.5.0_11\lib\javaws.jar;C:\Program Files\Java\jre1.5.0_11\lib\deploy.jar -Djnlpx.home=C:\Program Files\Java\jre1.5.0_11\bin -Djnlpx.splashport=1970 -Djnlpx.jvm="C:\Program Files\Java\jre1.5.0_11\bin\javaw.exe" -Djnlpx.remove=true -Djava.security.policy=file:C:\Program Files\Java\jre1.5.0_11\lib\security\javaws.policy -DtrustProxy=true -Xverify:remote -Djnlpx.heapsize=32m,512m
    java_command: com.sun.javaws.Main C:\DOCUME~1\ssiwach\LOCALS~1\Temp\1\javaws3
    Launcher Type: SUN_STANDARD
    Environment Variables:
    PATH=C:\Program Files\Java\jre1.5.0_11\bin;D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\mysql\bin;"C:\Program Files\Java\jre1.5.0_11\bin"
    USERNAME=ssiwach
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows Server 2003 family Build 3790 Service Pack 1
    CPU:total 2 (cores per cpu 1, threads per core 2) family 15 model 4 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht
    Memory: 4k page, physical 2097151k(438060k free), swap 4194303k(5136k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_11-b03) for windows-x86, built on Dec 15 2006 01:16:12 by "java_re" with MS VC++ 6.0
    ------------------------------------------------------------------------------------------------------------------

  • 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. :-)

  • Why?When send a String type param from Java to C,I get An unexpected error.

    The error trace like this:
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x10001d9c, pid=1944, tid=3204
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_07-b03 mixed mode, sharing)
    # Problematic frame:
    # C [sample.dll+0x1d9c]
    --------------- T H R E A D ---------------
    Current thread (0x00036158): JavaThread "main" [_thread_in_native, id=3204]
    siginfo: ExceptionCode=0xc0000005, reading address 0x00000051
    Registers:
    EAX=0x7ffffffe, EBX=0x26c24ad0, ECX=0x00000051, EDX=0x7fffffff
    ESP=0x0007f748, EBP=0x0007f9fc, ESI=0x0007fa38, EDI=0x0007fa88
    EIP=0x10001d9c, EFLAGS=0x00010206
    Top of Stack: (sp=0x0007f748)
    0x0007f748: 0007fa88 0007fa38 26c24ad0 7c930738
    0x0007f758: 7fffffff 00000030 7c931596 7c9306eb
    0x0007f768: 00000007 00000008 26c24ad0 0007f788
    0x0007f778: 0007f7b4 00ae29a4 00000000 22bf60d0
    0x0007f788: 10001005 00000000 00000001 00000000
    0x0007f798: 0007f790 02eb02b0 0007f7e0 7ffffffe
    0x0007f7a8: 00000000 00000051 0007f7dc 0007f7f4
    0x0007f7b8: 00000000 00000000 00000000 00000000
    Instructions: (pc=0x10001d9c)
    0x10001d8c: 89 85 a8 fd ff ff 85 d2 74 1e 8b 8d b0 fd ff ff
    0x10001d9c: 0f be 11 85 d2 74 11 8b 85 b0 fd ff ff 83 c0 01
    Stack: [0x00040000,0x00080000), sp=0x0007f748, free space=253k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C [sample.dll+0x1d9c]
    C [sample.dll+0x10ca]
    C [sample.dll+0x12e7a]
    j HelloWorld.sayHello(Ljava/lang/String;)V+0
    j HelloWorld.main([Ljava/lang/String;)V+11
    v ~StubRoutines::call_stub
    V [jvm.dll+0x86401]
    V [jvm.dll+0xdb172]
    V [jvm.dll+0x862d2]
    V [jvm.dll+0x8d2a2]
    C [java.exe+0x14c5]
    C [java.exe+0x69cd]
    C [kernel32.dll+0x16d4f]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j HelloWorld.sayHello(Ljava/lang/String;)V+0
    j HelloWorld.main([Ljava/lang/String;)V+11
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x00a7f6c8 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3216]
    0x00a7e3c0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2040]
    0x00a7d480 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1760]
    0x00a51f58 JavaThread "Finalizer" daemon [_thread_blocked, id=3212]
    0x00a50a70 JavaThread "Reference Handler" daemon [_thread_blocked, id=3208]
    =>0x00036158 JavaThread "main" [_thread_in_native, id=3204]
    Other Threads:
    0x00a4e178 VMThread [id=1952]
    0x00a808e0 WatcherThread [id=3220]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 576K, used 238K [0x22bd0000, 0x22c70000, 0x230b0000)
    eden space 512K, 46% used [0x22bd0000, 0x22c0b930, 0x22c50000)
    from space 64K, 0% used [0x22c50000, 0x22c50000, 0x22c60000)
    to space 64K, 0% used [0x22c60000, 0x22c60000, 0x22c70000)
    tenured generation total 1408K, used 0K [0x230b0000, 0x23210000, 0x26bd0000)
    the space 1408K, 0% used [0x230b0000, 0x230b0000, 0x230b0200, 0x23210000)
    compacting perm gen total 8192K, used 339K [0x26bd0000, 0x273d0000, 0x2abd0000)
    the space 8192K, 4% used [0x26bd0000, 0x26c24e90, 0x26c25000, 0x273d0000)
    ro space 8192K, 67% used [0x2abd0000, 0x2b12d9f8, 0x2b12da00, 0x2b3d0000)
    rw space 12288K, 46% used [0x2b3d0000, 0x2b973808, 0x2b973a00, 0x2bfd0000)
    Dynamic libraries:
    0x00400000 - 0x0040d000      c:\Program Files\Java\jdk1.5.0_07\bin\java.exe
    0x7c920000 - 0x7c9b4000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c91c000      C:\WINDOWS\system32\kernel32.dll
    0x77da0000 - 0x77e49000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77e50000 - 0x77ee1000      C:\WINDOWS\system32\RPCRT4.dll
    0x77be0000 - 0x77c38000      C:\WINDOWS\system32\MSVCRT.dll
    0x6d730000 - 0x6d8c7000      c:\Program Files\Java\jdk1.5.0_07\jre\bin\client\jvm.dll
    0x77d10000 - 0x77d9f000      C:\WINDOWS\system32\USER32.dll
    0x77ef0000 - 0x77f37000      C:\WINDOWS\system32\GDI32.dll
    0x76b10000 - 0x76b3a000      C:\WINDOWS\system32\WINMM.dll
    0x76300000 - 0x7631d000      C:\WINDOWS\system32\IMM32.DLL
    0x62c20000 - 0x62c29000      C:\WINDOWS\system32\LPK.DLL
    0x73fa0000 - 0x7400b000      C:\WINDOWS\system32\USP10.dll
    0x6d2f0000 - 0x6d2f8000      c:\Program Files\Java\jdk1.5.0_07\jre\bin\hpi.dll
    0x76bc0000 - 0x76bcb000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d700000 - 0x6d70c000      c:\Program Files\Java\jdk1.5.0_07\jre\bin\verify.dll
    0x6d370000 - 0x6d38d000      c:\Program Files\Java\jdk1.5.0_07\jre\bin\java.dll
    0x6d720000 - 0x6d72f000      c:\Program Files\Java\jdk1.5.0_07\jre\bin\zip.dll
    0x10000000 - 0x10033000      E:\jnis\sample.dll
    VM Arguments:
    java_command: HelloWorld
    Launcher Type: SUN_STANDARD
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.5.0_07
    CLASSPATH=.;.;C:\PROGRA~1\JMF21~1.1E\lib\sound.jar;C:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;C:\PROGRA~1\JMF21~1.1E\lib;
    PATH=C:\cygwin\usr\local\bin;C:\cygwin\bin;C:\cygwin\bin;C:\cygwin\usr\X11R6\bin;c:\WINDOWS\system32;c:\WINDOWS;c:\WINDOWS\System32\Wbem;c:\Program Files\Java\jdk1.5.0_07\bin;c:\Program Files\OPENXTRA\Ethereal;c:\Program Files\OPENXTRA\WinDump;d:\Program Files\jProbe\bin;c:\maven-2.0.6-bin\maven-2.0.6\bin;d:\Open Source\apache-ant-1.7.0\bin;d:\swtdlls;d:\Program Files\CVSNT\;c:\Program Files\OPENXTRA\WinPCap
    USERNAME=Administrator
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 9, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht
    Memory: 4k page, physical 515572k(238244k free), swap 1260260k(935080k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_07-b03) for windows-x86, built on May 3 2006 01:04:38 by "java_re" with MS VC++ 6.0
    Java Code like this:
         static{
              try{
                   System.loadLibrary("sample");
              }catch(Exception e){
                   System.out.println("Can't load sample.dll");
         //Declare native method
         public native void sayHello(String name);
      public static void main(String[] args){
        HelloWorld hw=new HelloWorld();
        hw.sayHello("QUKI");
      }And C code like this:
    JNIEXPORT void JNICALL Java_HelloWorld_sayHello
      (JNIEnv *env, jobject obj, jstring s)
         /* Obtain a C-copy of the Java string */
         //printf("Hello,every one");
        const char *str = (*env)->GetStringUTFChars(env, s, 0);
         printf("Java Call C success....%s\n",*str);
    }Any one can tell me why??Thanx very much.

    const char str = (env)->GetStringUTFChars(env, s, 0);
    printf("Java Call C success....%s\n",*str);
    Any one can tell me why??Thanx very much.That asterisk(*) in front of str in the printf() statement is dereferencing the variable. Thus it is a char and not a char*. But %s requires a char*.
    EXCEPTION_ACCESS_VIOLATION (0xc0000005) Note that when you get the above, with the ...05 error, that it always means you did something incorrect with a pointer somewhere.

  • Gray Screen of Death (moving from Java 1.1 to 1.4)

    I am in process of moving my applet from Java 1.1 to modern Java 1.4 with Swing. My concern is that users on MS IE with the ancient MS JVM will get the "gray screen of death" and no hint that something is wrong. The best option I've found so far seems to be this:
    http://www.chaingang.org/code/util/AppletLaunch.html
    where you have one applet start up, check the version, and then either report "you need a new version of java" or launch the next applet. I'm not sure whether this will work when the first applet is compiled for Java 1.1, and the second is for Java 1.4 (they use different class file formats).
    What are the recommendations for dealing with this situation? I've seen that Sun has some very complicated stuff about using OBJECT, EMBED, and APPLET tags:
    http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/contents.html
    Also stuff about "Java Web Start Applications":
    http://java.sun.com/developer/technicalArticles/JavaLP/javawebstart/AutoInstall.html
    I've also seen something about the "HTML Converter".
    This is all looks way complicated!! As long as I can tell users "go update your java" and direct them to the java install web page I'm happy... I don't want to try to get their install started automatically. And I'd rather keep my HTML code simple and clean if possible.
    Thanks in advance...

    1. Write an applet in 1.4 that simply displays a small image.
    2. Place the image on the webpage beside the applet.
    3. Put a line of html beside or under the image and the applet saying "If you cannot see this image here (as in applet loaction) then you must download the 1.4 jre here"
    Yahoo provide an applet as a means of editing ones geocitys website. This is how they ensure the user has the required jre. Crude but very effective and without complication.

Maybe you are looking for

  • Two Artists with the same name in iTunes Store - how to get that split?

    A friend has a band named White Rhino and they have two albums on iTunes; and there is another band named White Rhino - iTunes groups them together on the store; anyone know how to get them categorized as two different Artists?

  • Usb not recognized when windows7 installed on mac book pro retina

    Hi, I am trying to install windows 7 to mac book pro - retina display with mavericks. I managed to come to the point where windows installed and starts and I need to install the boot camp on the windows. I am having problems at this stage. Windows do

  • Hiring the hired employee

    Hi, Scenario: I have hired an employee, and he posses master data. now i need to hire the same employee (thru PA40)with same master data. system is giving error message "identical data" and exiting. Question: 1. where in the system would check the du

  • Interactive ALV list Report Using OOPS

    Hi Experts!! I would like create secondary list using ABAP OPPS (Events). Anybody can give me idea how to do that . On clicking of perticurar row + column. Secondary list should be displayed. Please do not suggest ALV Grid. I know how to do it with A

  • What is BOM? Steps Needed. How is it Related to Product Costing

    Gurus, What is BOM? How is it related to Product Costing and Profitability Analysis and CO? Technical help and steps would be appreciated. Thanks. Points available.