Problem invoking JVM from Windows

Hi all,
I tried to create a JVM instance as laid out in the examples. The JVM is never getting created. I am using Visual C++ (I need to, when the code works I will be creating a DLL that is an addon to someother piece of software).
I have posted the code below::
#include "stdafx.h"
#include "invoke2.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// The one and only application object
CWinApp theApp;
using namespace std;
int main(void)
     int nRetCode = 0;
     // initialize MFC and print and error on failure
     if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
          // TODO: change error code to suit your needs
          cerr << _T("Fatal Error: MFC initialization failed") << endl;
          nRetCode = 1;
     else
          JNIEnv *env;               /* The java vm environment                                        */
          JavaVM *jvm;               /* The actual jvm                                                  */
          CString fname;               /* The file name of the generated intermediate obj file */
          JDK1_1InitArgs vm_args;
          jint res;
          jint vmavail;
          jclass cls;
          jmethodID mid;
          //char classpath[4096];
          bool viewerready;          /* is this java viewer valid?                                   */
          vm_args.classpath=".";
          vm_args.version = JNI_VERSION_1_4;
          vmavail=JNI_GetDefaultJavaVMInitArgs(&vm_args);
          if(vmavail < 0)
               AfxMessageBox(" That VM version is not available. ",100,100);
               viewerready=false;
               jvm=NULL;
               env=NULL;
          else
               vm_args.classpath=".";
               res = JNI_CreateJavaVM(&jvm,(void **) &env,&vm_args);
               if(res < 0)
                    AfxMessageBox("Could not create JVM instance. \n Check your classpath. \n 3D viewer will not be available. ",100,100);
                    jvm=NULL;
                    env=NULL;
                    viewerready=false;
               else
                    cls = env->FindClass("OBJViewer");
                    if(cls == 0)
                         AfxMessageBox("Can't find the java OBJViewer class. ",100,100);
                         viewerready=false;
                    mid = env->GetMethodID(cls, "OBJViewer", "");
                    if(mid == 0)
                         AfxMessageBox(" java class OBJViewer has no constructor OBJViewer() ");
                         viewerready=false;
                    env->CallStaticVoidMethod(cls, mid);
     return nRetCode;
}

Hey guys :)
I incorporated the changes suggested by David and "reberst" and then did the stuff told by "LathaDhamo".
Now I am able to invoke the VM without problems and my test program runs and displays windows and takes in input etc.. Thank you, Thank you, Thank you!!
But now, I noticed that all this happens only when I am in debug mode in VC++ and step thru the program. When my external program loads the DLL I created automatically, I get the error message that the "JavaTest" class was not found. This will lead to errors when I deploy the DLL or package it for others. How do I ensure that the class is always found? What do I have to do?
I am sorry for being so amtuerish and asking so many questions. This is my first time using JNI from the native side.
Thank you,
vijai.
JavaOBJViewer::JavaOBJViewer(void)
     memset(&args, 0, sizeof(args));
     args.version = JNI_VERSION_1_4;
     args.nOptions = 2;
     options[0].optionString = "-Djava.class.path=.";
     options[1].optionString = "-Djava.library.path=.";
     args.options = options;
     args.ignoreUnrecognized = JNI_TRUE;
     res=JNI_CreateJavaVM(&jvm, (void **)&env, &args);
     if(res < 0)
          AfxMessageBox(" The JavaVM could not be initialized. \n Refer to the documentation on environment variable settings. \n 3D Viewer will not be available while modeling. ");
          jvm=NULL;
          env=NULL;
          viewerready=false;
     else
          cls = env->FindClass("JavaTest");
          if(cls == NULL)
               AfxMessageBox("Can't find the java JavaTest class. \n 3D viewer will not be available while modeling. ",100,100);
               viewerready=false;
          else
              mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
               if(mid == NULL)
                    AfxMessageBox(" java class JavaTest has no main method. ");
                    viewerready=false;
               else
                    tempf = env->NewStringUTF("testenvp.obj");
                    logf = env->NewStringUTF("java_viewer_log.txt");
                    if((tempf == NULL) || (logf == NULL))
                         AfxMessageBox("The Java VM had insufficient memory to create the argument array. ",100,100);
                    else
                         mainargs = env->NewObjectArray(2,env->FindClass("java/lang/String"), logf);
                         if(mainargs == NULL)
                              AfxMessageBox("The Java VM had insufficient memory to create the argument array. ",100,100);
                         else
                              env->SetObjectArrayElement(mainargs,2,tempf);
                              env->CallStaticVoidMethod(cls,mid,mainargs);
                              jthrowable exc;
                              exc = env->ExceptionOccurred();
                              if(exc)
                                   AfxMessageBox(" An unknown exception occurred. ",100,100);
                                   viewerready=false;
                              else
                                   viewerready=true;
}

Similar Messages

  • Windows 8.1 Problem with games from windows store.

    I've got a problem with games from windows store. The installation is going well without any problems, however when I try to open it it's loading and then it turns off. The same problem happens when I try to use Games for Windows. I've use a sfc scan and
    it shows some errors but unfortunately it cannot fix them. Should I share the CBS log or find the solution somewhere else? I hope you help, best regards.

    Hi,
    According to my experience, the problem like store game app open failed probably caused by hardware driver. such as Audio and Graphic driver. So, first of all, please try to reinstall these two driver to fix this problem for test.
    In addition, for SFC scan failed problem, it can be caused by many reasons, I would suggest you use another command to fix your system for test.
    Dism /Online /Cleanup-Image /ScanHealth
    Also you can test SFC command in Windows 8.1 safe mode.
    Thirdly, if problem persists, please check Event Viewer, generally speaking, it would record the app open failed events.
    Roger Lu
    TechNet Community Support

  • Problems with switch from Windows to Mac

    I recently switched from Windows PC to a new Mac and cannot install the Acrobat 7.0 Professional CD that I used with Windows on the Mac. Am I missing something, or do I need to buy a whole new product?

    No Windows program will install on Macintosh (a very few products have
    both Windows and Macintosh on one disk, but not here).
    If you call Adobe you can buy a "crossgrade" for a reduced price. You
    will need to upgrade to Acrobat 9.0 at the same time.
    Aandi Inston

  • Office 2004 for Mac:: Problems Importing Data from Windows

    I'm not sure if this is the best place to post this but:
    I am switching from Windows and Outlook 2003 and trying to move my data from Outlook into Entourage. I was somewhat successful using O2M to import my Contacts and E-Mail.j However O2M created a bunch of .ics files that I can’t seem to get into Entourage’s calendar.
    I also have a lot of Outlook Notes and Tasks that I can’t seem to import or drag into Entourage’s Notes and Task windows.
    Any suggestions? I didn’t think it would be so hard. You would think that Microsoft as the vendor of both programs would have provided a smoother method of moving data between their programs.
    Thanks
    Ben

    Thanks for the response. I will check the site that you reference.
    Just out of curiousity--why is this not a good place to ask this question? As a new user to the Apple/Mac community am I relegated to asking questions only about Apple hardware and software written only by Apple? One of the enticements for switching over to Apple from Windows, besides getting tired of having to be a technical wizard, were all the platitudes about how easy it is to switch. Well it isn't all that easy.
    Don't get me wrong, I am loving my new MacBook Pro and I imagine once I get my Outlook data over to the Mac I will be really happy. But given that all my email, notes, tasks, calendar and contacts for years have been on my Windows machine I would have liked a little less hair pulling trying to get it over to my mac. It has not been clean and it hasn't been easy [over a week now].
    Somehow I thought "Well I'm probably not the first person to be taking this route and where would I find the largest number of people who may have already gone before me and could offer directions/suggestions." I did do my research and based on the number of postings concluded that Office2004 for Mac was the best choice if I was using Outlook on Windows and needed to continue to use Word/Excel/Powerpoint with the rest of the business world. And it did appear from all the postings that a lot of people use this package.
    Again, this is not meant to come off harsh, but it is a little off-putting to be told "This isn't the appropriate place for this question"
    Thanks
    Ben

  • Problem invoking Javascript from applet

    Hi,
    I have a hidden iframe in my JSP. While submitting the form within the JSP, I set the target of the response page as the iframe and disable all the form elements in the JSP . The response page contains an applet that pops up a window(a JFrame). On pressing the close button of the applet's frame, I invoke a Javascript method in the JSP. This javascript method enables all the components on the JSP.
    Now the issue is that, when I press the close button, the browser just hangs... This doesn't happen on all the browsers.. It works with Opera. In IE it doesn't work all the time. Some times IE just hangs... Any idea what the issue could be?? Pls let me know if the problem is not clear..
    Thanks in advance..
    regards,
    Anand

    Funny I've just posted something about this on another thread.
    http://forum.java.sun.com/thread.jsp?forum=54&thread=157547
    You can apparently call methods on your applets from javascript.
    http://developer.netscape.com/docs/manuals/communicator/jsguide4/livecon.htm#1007749
    I know that most of the LiveConnect package works in NS4, NS6, IE4 and IE5, but I have always called out to JavaScript from Java not the other way around so I cannot vouch for this in IE.

  • Possible problem calling java from Windows DLL

    I'm am developing on Windows NT 4.0 using JDK 1.3.1.
    What I want to do is to create a DLL that calls into java using the Invocation APIs.
    I am able to successfully create a JVM inside my DLL and find the java classes that i need. The problem is if one of those java classes happens to perform a JNDI function (e.g. InitialDirContext), my DLL doesn't ever return from a call to that class's method.
    Does anyone have any suggestions?

    Thanks for your reply.
    All my JNI functions return ok with out error/exception. The problem is, the one function never returns so that I can check for errors/exceptions.
    I found a work around for the problem. For some reason if I wrap the JNI code in a C++ class, the call hangs. But if I pull that code outside a C++ class, it works like it is supposed to. Not sure why this would be the problem.
    Thanks again for your reply

  • Samsung SSD causing problem with upgrade from Windows 8.0 to 8.1

    I'm having trouble upgrading my HP Desktop from the OEM installed Windows 8.0 to 8.1.  I first attempted the upgrade when 8.1 was first rolled out.  It seemed to upgrade okay, but after a reboot I was left with a black screen... no error messages, just a black screen.
    I retried it this morning, but this time it failed with DPC_Watchdog_Exception and then Machine_Check_Exception.  After searching through several forums, I'm "guessing" it may be Disk 0, which is a Samsung 830 Series SSD (Model: MZ7PC256/0H1, s/n: S0U3NSAC705912, p/n: MZ7PC256HAFU-000H1) that was installed and configured by HP when I ordered this desktop in 2012.
    Samsung's Magician software doesn't recognize this SDD as a supported product, but they do identify it as a Samsung MZ7PC256HAFU-000H1, with Firmware version CXM05H1Q.  I thought I'd see if a firmware upgrade was available, but there's no information about this SSD on Samsung's support site. Also, HP doesn't offer any firmware for this SSD... not even the original firmware.  Everything I've seen on the internet says it's a custom OEM SSD that's not supported by Samsung. 
    I'm not desparate to upgrade to Win8.1, but I would like to know exactly why the upgrade keeps failing.  I have another SSD available (a Samsung 850 Pro, model: MZ-7KE256BW) that I've considered using to replace the current Drive 0, but I hate swapping out parts without knowing it's actually the problem.
    I'm open to advice. The info on my current system follows. Also, I should point out that there are no device conflicts nor outdate drivers.
    HP Envy h8-1420t CTO Desktop PC, s/n: 2MD3020CF9, Product No. C1U69AV #ABA
    Windows 8 Pro 64 (installed by HP)
    Intel Core i7-3770 3rd Gen, Quad-core (Ivy Bridge) 64-bit Processor, 3.4GHz
    Memory: 16GB DDR3
    Drive 0: 256GB SSD, Samsung 830 Series, Model: MZ7PC256/0H1, s/n: S0U3NSAC705912, p/n: MZ7PC256HAFU-000H1
    Drive 1: 1TB 7200 rpm SATA hard drive, Model: WD10EZEK-60ZF5A0, s/n: WCC1S1261511
    Drive 2:  750GB SSD, Samsung 840 Series, Model: MZ-7TE750BW, s/n: S1DMNEADB03609
    This question was solved.
    View Solution.

    Hi,
    You will find the latest firmware for the Samsung 830 at the Samsung SSD download site.  Additionally, you will also find the latest version of the Samsung Magician.
    Backup your data and be sure to create the external HP recovery media.
    I prefer not to clone but rather to use the external HP recovery media to load the SSD.
    If you are not on the latest SSD firmware then flash the SSD.  Use the latest version of the Magician to do so.
    Disable Secure Boot in the BIOS before cloning the hard drive.
    Then reformat and clone the SSD using the latest Samsung migration software. Use the original HP hard drive as the source and it needs to be intact as you need to bring across all of the partitions.
    Power off the PC and disconnect the original boot HD.
    Connect the SSD to the original boot SATA port.
    Do not have any other SSDs or hard drives connected that contain an EFI partitions or you might run into issues with multiple Windows boot loders.
    HP DV9700, t9300, Nvidia 8600, 4GB, Crucial C300 128GB SSD
    HP Photosmart Premium C309G, HP Photosmart 6520
    HP Touchpad, HP Chromebook 11
    Custom i7-4770k,Z-87, 8GB, Vertex 3 SSD, Samsung EVO SSD, Corsair HX650,GTX 760
    Custom i7-4790k,Z-97, 16GB, Vertex 3 SSD, Plextor M.2 SSD, Samsung EVO SSD, Corsair HX650, GTX 660TI
    Windows 7/8 UEFI/Legacy mode, MBR/GPT

  • Sync problems after switch from Windows to Mac; cannot read/write error msg

    I'm not sure if this is a hardware or software issue.
    I recently switched from a PC to a Mac. To move my iTunes files (50GB) I simply dragged and dropped them from my external HD to my new computer. I know that Apple does not recommend this process, but when I needed to move my library between drivers earlier this year, it was the only way I could do it without getting an error message that killed the process.
    Moving the files seemed to be a success. Everything appeared in iTunes, I was able to play the music, etc.
    I then tried synching my iPod (Classic 160 GB – I think 5th gen, it’s about 3 years old) on the new computer. I got some message that said you can only have one iPod per account and that I would have to wipe the iPod before syncing. I let it do that.
    Here's where problems began:
    With a few gigs to go in the sync I got a message that says something to the effect that iTunes cannot read or write to the iPod. Even though must of the library had been transferred to the iPod, before disconnecting the iPod iTunes wiped all but a few hundred megs worth of music from it. I've tried restoring the iPod a few times but that has had no effect. The first time I tried to sync the iPod it was formatted for Windows. I have reformatted it for Mac.
    Also noteworthy is that the first 3/4ths of my library copies very quickly -- 1GB a minute -- but then it eventually slows down to where 100 MB takes 10 minutes. It copies the files in a different order every time, so it doesn't look like it's getting hung up on the same files every time.
    In case I had a corrupted file, I deleted all the files added to the library since my last successful sync.
    Suggestions?
    Should I just go to the nearest Apple store and beg for mercy?

    Hi!
    same problem here.I can use around 30G of my iPod Classic 160G.If i try to upload more than that it will take very long time and finally freezes.
    Have no idea what to do..

  • Problem launching Firefox from Windows with file path that contains space characters in the html file's file name

    We have a software application that programmatically launches the default web browser using the Windows shell execute function ("ShellExecuteA" in the "shell32.dll" library of the Windows API) along with a file path for a saved local html file that is to be displayed. In the case that FireFox is the default browser and the file path for the html file contains any space characters in the html file's file name, Firefox (in this case v7.01) will display an error message "File not Found..." and then will also proceed to open tabs for each of the individual words in the file name, launching as the URL path, each individual word appended to ".com".
    In the following example, the path "C:\KSSecOfState\Forms\Kansas Secretary of State - Filings and Forms.htm" when launched programmatically, resulted in the error message "File not Found...Firefox can't find the file at /C:/KSSecOfState/Forms/Kansas." and opened up browser windows for "http://www.secretary.com/", "http://www.of.com/", "http://www.state.com/", "http://www.and.com/", and attempted to launch "http://forms.htm". If the same file (renamed) is launched using the path string "C:\KSSecOfState\Forms\KansasSecretaryOfState-FilingsAndForms.htm" the file opens up correctly in Firefox. Clearly the presence of spaces in the file name is causing the problem.
    I should also note that either path (with or without space characters) works properly if pasted directly into the Firefox URL path menu bar for a live instance of Firefox. The test path strings I used were:
    C:\KSSecOfState\Forms\KansasSecretaryOfState-FilingsAndForms.htm
    C:\KSSecOfState\Forms\Kansas Secretary of State - Filings and Forms.htm
    Does anyone know anything about this problem or how to work around it (other than the obvious answer of taking the spaces out of the file name which is not possible for this application). It seems the problem is specific to Firefox. IE works properly if launched programmatically with spaces in the file name passed to it. I haven't tested other browsers yet.
    Thanks!

    If starting from ShellExecute works the same as starting from the command line then there are two options:<br>
    Put everything inside double quotes<br>
    '''C:\Program Files\Mozilla Firefox\>'''firefox.exe '''"c:\test\svg test.htm"'''<br>
    Convert to a valid url with file:// protocol and percentage-escaping the space<br>
    '''C:\Program Files\Mozilla Firefox\>'''firefox.exe '''file://c:\test\svg%20test.htm'''<br>

  • Problems opening files from Windows server

    Since upgrading to Leopard, some files saved on an Windows server no longer open in the correct application. For example, documents created in Quark 6.1 or 6.5 show up as Unix Executable Files and attempt to open in the terminal. Copying the file to my desktop does not help. The files work correctly for pre-Leopard Macs. New files saved from Quark 6.5 on a machine running Leopard onto the server work fine for other Leopard Macs, but pre-Leopard Macs try to open the files with Script Editor. I can change the "Open With" preferences in a get info window for individual files, but if I select "Change All", i get an error that "not enough information is available".
    Also, Photoshop EPS files created with pre CS 1 versions of Photoshop appear as Illustrator EPS files.

    I'm not sure if anyone is working on it.
    I did copy everything to the Mac running 10.3.9 (above I mistakenly said the computer I was going to copy to was running 10.4).
    I then updated the Mac to 10.5 and all the files continued to open with the proper program even after I put them back on the server.
    I know that it's a hassle, but it worked. I guess if you don't have another Mac still running 10.3, you could put everything on your server, reformat you Mac to OS 10.3.9, then copy the server to your Mac, then upgrade to 10.5. That is, if you have a large enough hard drive. I don't claim to be a Mac expert so I can't guarantee anything in this paragraph. It just seems like that would be the only logical step given what worked for me with upgrading the computer running 10.3.9. Even after doing that, I'd then do a clean install on the computer. My Mac was having problems so that's what I did and plan on doing to the other Mac when I get the chance.
    I guess it all depends how many files you have and how annoyed you are at having to Control click all your files to open them.

  • Problem while "migrating" from Windows to Mac OS X

    Over the last few months my Macbook was damaged and in repair. At that time I used a Windows PC instead and it was no problem to keep on using my old iTunes library file after I added the file extension ".itl".
    Now my Macbook is back and I wanted to open my iTunes library using Mac OS X, not expecting any bigger problem.
    To my astonishment iTunes keeps on crashing, showing the following error message: "The program iTunes could not be opened. An unknown error occured (13001)" (translated liberately, as my system is set to German).
    On both operating systems iTunes is running in the newest version. What could help solving my problem is the information that my iTunes Media folder including my iTunes library files are stored on an external harddrive formatted in HFS+.
    Windows had writing access on this file system using the software "Macdrive" in version 9.
    I already tried moving the library files to my desktop and opening them from there, also I tried to create a new library just for testing purposes on the same harddrive. Both tests failed with the same error message.
    Windows is still able to open the library as it was before.
    I searched for similar problems on the internet but couldn't find any help, so I hope that someone on here has any helping tips!

    Finally figured out the problem on my own. My external hard drive was named <Mobile 2.5">. In this thread I read about others having a problem when their hdd was named in a comparable way (e.g. <storage for 21" iMac>).
    I renamed my drive to <Mobile 2.5> and the problems are gone!

  • Problems since update from Windows 8 to 8.1

    So the other day the Windows 8.0 side of my 27-inch, Late 2013 iMac with Fusion drive forced me up update to Windows 8.1 - it just started doing it automatically when I was on my lunchbreak.  It seemed to update fine, and everything seemed to work once it booted up in 8.1.  I noticed that the sound was no longer working on the Windows 8.1 side - it would only make the startup sound after a restart/turning on, and there was a red light coming out of the audio jack.  Sound worked fine on the Mac side still.  So, I updated the drivers here (Boot Camp Support Software 5.1.5640) based on my computer model.  During the instal of the drivers, it said "Need to repair drivers", and then went on to install without any problems that I could see.
    This has now fixed the Sound driver issue, but now my keyboard is stuck in French mode (I think?) where when I type the "/?" character, it types "é" or "É".  I cannot seem to fix this by going into Languages in Control Panel, or by re-installing the drivers.
    What can I do?  Are there any more details I can give to help someone problem solve this with me?

    Hi,
    For the issue, let us try rebuilding performance counters to check the result.
    Press Win+x, and click Command Prompt(admin)
    Type "CD c:\windows\system32",and Enter.
    Type "LODCTR /R", and Enter.
    Note: This let you rebuild the perf registry strings and info from scratch based on the current registry settings and backup INI files.
    Keep post.
    Regards,
    Kelvin hsu
    TechNet Community Support

  • Problem:  short filenames from Windows apps

    Whenever I save a file from a Windows application on Solaris, if the filename is 8 characters or less, it converts the filename entirely to lowercase, but with 9 characters or more, it works fine. ie:
    1234567890
    abcdEFGHI.txt --> abcdEFGHI.txt
    abcdEFGH.txt --> abcdefgh.txt
    Any ideas?

    Hi,
    via samba, pcnetlink, nfs or what?

  • Invoking jvm from a java application

    hello people,
    i would like to run a java application 'B' from within another java application 'A'. i have a thread sub class that does this. it is given
    below: (please pay attention to the run method)
    import java.io.*;
    import javax.swing.*;
    public class InvokingThread extends Thread
    private File n=null;
    private JTextArea outputArea;
    private String message="",action="";
    private String pathToBin,errors,input,classpath;
    private EvaluatorClient clientRef;
    //initialize InvokingThread object
    public InvokingThread(File name,String act,String path,String cp)
    outputArea=new JTextArea(10,25);
    outputArea.setEditable(false);
    outputArea.setLineWrap(true);
    n=name;
    pathToBin=path;
    classpath=cp;
    action=act;
    System.out.println((action.equals("compile"))?"compiling":"executing");
    public void setClientRef(EvaluatorClient r)
    clientRef=r;
    //process action
    public void run()
    Process proce=null;
    try
    if(action.equals("compile"))
    proce = Runtime.getRuntime().exec(pathToBin+"/javac "+n);
    else if(action.equals("execute"))
    proce = Runtime.getRuntime().exec(pathToBin+"/java "+classpath+" "+n); //run application
    Thread.sleep(5000);
    byte[] errorData = new byte[proce.getErrorStream().available()];
    proce.getErrorStream().read(errorData);
    byte[] inputData = new byte[proce.getInputStream().available()];
    proce.getInputStream().read(inputData);
    errors = new String(errorData);
    input = new String(inputData);
    System.out.println((errors.length()>0)?"error string"+errors:"no errors");
    System.out.println((input.length()>0)?"input string"+input:"");
    if (errors.length() == 0 & action.equals("compile"))
    outputArea.setText("Compiled successfully");
    if(clientRef!=null)
    if(!clientRef.isTimeUp())
    clientRef.toggleMenuItemState(4,true);
    clientRef.toggleMenuItemState(5,true);
    clientRef.compilationOutcome("success");
    JOptionPane.showMessageDialog(null,new JScrollPane(outputArea));
    else if (errors.length() != 0 & action.equals("compile"))
    outputArea.setText("Compile Errors:\n" + errors+""+input);
    if(clientRef!=null)
    clientRef.compilationOutcome("failure");
    JOptionPane.showMessageDialog(null,new JScrollPane(outputArea));
    else if(action.equals("execute"))
    if(errors.length() != 0)
    outputArea.setText("Runtime errors:\n" + errors);
    JOptionPane.showMessageDialog(null,new JScrollPane(outputArea));
    else if(input.length()!=0 )
    outputArea.setText(input);
    JOptionPane.showMessageDialog(null,new JScrollPane(outputArea));
    catch(Exception e)
    e.printStackTrace();
    System.out.println("thread awake,invoking thread terminating");
    }//end run
    The above code worked when i used it with the rest of my program.
    as we can see the thread waits for 5 seconds before it reads the inputstream and error stream of the sub process returned by Runtime.getRuntime().exec(). But what happens after the thread terminates; i am unable to process subsequent runtime messages/exceptions from the application 'B'.
    so my question goes thus: is there a way that my thread can continually listen to the error stream and input stream of the sub process while application 'B' is still running so as to process any messages returned by java form the application 'B' ? or is there a better way of doing what i set out to achieve i.e running a java application from within another java application
    timi

    Runtime.getRuntime().exec("rundll32
    url.dll,FileProtocolHandler
    mailto:[email protected]&subject=Foo&body=Bar");yawmark, where do you get such information from? (in all seriousness :-) )
    How (the hell) can you find out what args to pass to a program?
    and is "FileProtocolHandler" a place-holder? if so what for?
    thanks, :)
    lutha

  • Problem invoking iTunes from certain browsers

    Users on Mac OSX using Firefox and Opera cannot open iTunes from the following iTunes U enabled URLs (http://asuonline.asu.edu/itunesu, http://itunes.berkeley.edu, http://itunes.stanford.edu, http://www.fuqua.duke.edu/itunes.), and our own URL. Is this a browser specific issue?

    I don't know about Opera, but I think the cause of this on Firefox is your preferences.
    In the address bar type: "about:config". Now in the Filter text area that has appeared type "itmss".
    Make sure that the value of the "network.protocol-handler.external.itmss". The value is true.
    Now enter this url into the address bar:
    itmss://deimos.apple.com/
    This will likely bring up a dialog box in Firefox which basically asks if you are sure you want to use an application different from Firefox to open this URL. Check the "Remember...." box and then click "Okay". That should permanently solve this problem.
    This is a hassle, but it is a good security feature of Firefox.

Maybe you are looking for

  • How do I add a digital signature to my online form?

    With regular Adobe (Standard or Professional) software, you can add a digital signature line.  I want to know how I can do it on FormCentral. When I PDF the form I created on FormCentral and try to add the digital signature in Adobe, I get a message

  • Error while adding PNI for too many clients

    Hi, I have added bunch of hosts to the OSB server and while trying to add PNI for all these hosts I am getting the following error. I have a total of 42 clients. If I add 20 to 25, I am okay, otherwise I am getting the error below. Can someone tell m

  • Mac Mini 2011 Sleep of Death

    I have a Mac Mini 2011 with Lion factory installed configured with an original Apple Keyboard and a LG - HDMI monitor. If the Mini goes to sleep either manually using the Apple Menu or based on Settings , it does not wake up ! Any  subsequent attempt

  • Nested Selection Screen Blocks

    Hi friends, My requirement is to display the two nested blocks in the selection screen and the radio button parameters defined should come in a single group. as below........ !   Begin Block1       !        * Radio  Button 1! !  Begin  Block2        

  • Can't see the java sign on the address bar

    I need to enable java to see a web page but there is no java sign on the address bar. Something has changed because I used to be able to see the web page before