Command line won't work with ProcessBuilder

Hi,
I am trying to run the following command line from the ProcessBuilder:
java -cp .\dist\ReflexionTest.jar ReflexionTest.Main2but I always get a
CreateProcess error=2, the specified file cannot be foundYet, when I run the code from a DOS window, it works fine. I have made sure that both commands are started from the same directory.
Anybody knows what is happening? How can I solve this?
Thanks,
J.

I am using the second constructor.
Here is the code for class Main1:
package ReflexionTest;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main1 {
    public static void main(String[] args) {
        System.out.println("Starting Main1");
        System.out.println("Main1 USER DIR = " + System.getProperty("user.dir"));
        ProcessBuilder MyPB = new ProcessBuilder("java -cp " + "ReflexionTest.jar" + " " + Main2.class.getName());
         File TempDir = new File(System.getProperty("user.dir") + File.separator);
         MyPB.directory(TempDir);
        Process TheProcess = null;
        try {
            System.out.println("Starting Main2 process\n");
            TheProcess = MyPB.start();
            System.out.println("\nExit value = " + TheProcess.exitValue() + "\n");
        } catch (IOException ex) {
            System.err.println(ex.toString());
}And here it is for class Main2:
package ReflexionTest;
public class Main2 {
    public static void main(String[] args) {
        System.out.println("Main2 started !!!");
}Both classes are in the same Netbeans project. Main1 tries to call Main2 from the ReflexionTest.jar itself. I have manually copied the ReflexionTest.jar file in the user dir file.
Thanks,
J.

Similar Messages

  • HT1937 Hi . I am using a carrier that is not listed in my country which is Saudi Arabia and I'm using Mobily line it won't work with me ..what should I do ?

    Hi . I am using a carrier that is not listed in my country which is Saudi Arabia and I'm using Mobily line it won't work with me ..what should I do ?

    Contact that carrier's technical support people.  It sounds like your issue is with that specific carrier, so only they will be able to help you make a particular device work on their network.
    P.S. if you mean you bought a phone from Mobily and are trying to use it with another carrier, you cannot.  A mobily phone will be locked to mobily, and according to Apple's list, they do not offer unlocking of their iPhones (http://support.apple.com/kb/ht1937).

  • Solaris 10 won't work with 2nd harddisk

    I installed Solaris 10 on this Dell 5150 with only 1 SATA hard drive setup, all went well, and I could view the disk in the disk management window.
    However, I setup a 2nd hard drive, identical to 1st drive. Solaris wont recognize it and gives an error when trying to view disks in disk management window?
    How do you setup a 2nd hard disk for mirroring on Solaris? Are there some command line utilities that work when the disk management window will not?
    Thanks,
    Jon

    Hi, here is what you can read on solaris x86 faq :
    http://www.sun.drydog.com/faq/
    (6.1) How do I add additional drives?
    First, you must have Solaris scan for the new drive. Become root and type: "touch /reconfigure; /usr/sbin/shutdown -i6" This rebuilds the /devices/ and /dev/ directories.
    ATAPI and SCSI the drives are already low-level formatted. If you wish to format a SCSI you can use /usr/sbin/format that comes with Solaris. A second drive install would use format.
    To create and use a filesystem:
    * Select the disk
    * /sbin/fdisk (select the whole disk or partial for format)
    * Write the label with the "label" option partition, check the partition arrangement
    * Create a filesystem with /usr/sbin/newfs on the drive. E.g. "newfs /dev/rdsk/c0t1d0s0" creates a filesystem on the the whole drive with SCSI ID 1.
    * Create your mount point directory, if it doesn't exist. For example, mkdir -p /local
    * mount the partition on your favorite mount point directory. For example, mount /dev/dsk/c0t1d0s2 /local mounts slice 2 of disk 0 of SCSI ID 1 of SCSI controller 0 at /local.
    * Add a line to your /etc/vfstab file. See the vfstab man page for details. For example:
    /dev/dsk/c0t1d0s2 /dev/rdsk/c0t1d0s2 /local ufs 1 yes -
    [Thanks to Bob Palowoda's FAQ and Sonny Leman]

  • My chosen site won't work with fp11. I need to revert to a fp10

    My chosen site won't work with fp11. I need to revert to a fp10. I doubt I can copy and navigate lines of text and symbols to remove something completely and try to see what choice to use to replace it, and ever suceeed.

    See How do I revert to a previous version of Flash Player?

  • My Viewsonic monitor won't work with the Imac using the Mini Port to DVI adapter.

    My Viewsonic monitor won't work with the Imac using the Mini Port to DVI adapter. I also tried the HDMI to DVI adapter ane the Mac-Mini with same result. The monitor does work on my older Macbook Pro that has the DVI connector. Is it a Software/Driver issue ?

    Should be extremely simple, please carefully read Connect multiple displays to your Mac. If you still have problems then it's probably a cable issue that would be resolved by replacing the adapter cable. You should be using this adapter. If you are using a third party adapter that might be your problem!

  • New ipod touch won't work with itunes 10.6.3 says it needs 11.1 but I cannot load that on my macbook using OSX 10.5.8 any way around this?

    New ipod touch won't work with itunes 10.6.3, says it needs 11.1 or newer but I cannot load that onto my MacBook running on OSX 10.5.8 - is there anyway around this?

    No. If your MacBook has an Intel processor you can update to OSX 10.6.8 and then install the latest iTunes.
    A 5G iPod with iOS 7 requires that if you have a Mac you have OSX 10.6.8 or later.
    You can get 10.6.8 here:
    http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard

  • TS1363 "An iPod has been detected but it could not be identified properly"  iPod Nano 7g and 3g won't work with Windows 8 PC. worked fine up until a month or so ago and now they are not recognized.

    "An iPod has been detected but it could not be identified properly"  iPod Nano 7g and 3g won't work with Windows 8 PC. worked fine up until a month or so ago and now they are not recognized.

    Hi cueball819,
    Thanks for using Apple Support Communities.  This article has steps to try if your iPods aren't recognized by iTunes or Windows:
    iPod not recognized in My Computer and in iTunes for Windows
    http://support.apple.com/kb/TS1369
    Cheers,
    - Ari

  • Itunes updated and now it won't work.  I unstalled it and reinstalled the older version and it still won't open. Says the itunes library won't work with the older program. Help

    Itunes updated and now it won't work.  I unstalled it and reinstalled the older version and reinstalled a older version and it still won't open.  Says the itunes
    library won't work with the older program.  Please help

    It says it cannot removed the older version of iTunes.
    Doublechecking before proceeding ... what's the precise text of that message, please? (There's a couple of different ones I can think of that you might be getting.)

  • My cellcom line doesn't work with my iPhone here in Israel, why? Is there any way I can solve this issue?

    My cellcom line doesn't work with my iPhone here in Israel, why? Is there any way I can solve this issue?

    Please explain.
    What does "cellcom line doesn't work with my iPhone" mean?
    What are you trying?  What is happening?
    Where did you buy the iphone?
    Any info abnout your issue at all?

  • I would like to update to Firefox 5.0.1, but I can't due to, too many things won't work with the version & will be disabled.

    I have wanted to update from 3.6.22, to 5.0.1, but can't do to the following reasons: I can't due to, too many things won't work with the version & will be disabled. They are: Microsoft. NET Framework Assistant 1.2.1, Iconix 3.90.1, HP Detect 1.0.5.1, Yahoo! Toolbar 2.3.5.201101200332202 (I don't care about Yahoo! Toolbar, because I don't use it!). As soon as these issues are fixed, I will be able to update, to the latest versions. These issues should be fixed & ready to work, before a new version is available. Thank you!

    Try using this extension to force compatibility.
    * https://addons.mozilla.org/en-US/firefox/addon/add-on-compatibility-reporter/
    Check and tell if its working.

  • I have a Canon D60 camera, my raw files won't work with the raw converter in my Photoshop CS5. Do I need CS6?

    Photoshop CS5 won't work with the raw files from my new Canon D60 camera. Do I need CS6?

    A Canon EOS D60? It had support since Camera Raw version 1.0.

  • FM transmitter won't work with my iPhone

    I bought a Premier FM transmitter from Auto Zone the other day. It has a 30-pin connector with an led panel that lights up when you connect it to an apple device. It's suppose to work with all 30-pin devices but doesn't work with my iPhone 4 (iOS 7.1.2). I have tried it with my iPod Touch 2g and two other iPhone 4's that belonged to my friends, and it worked with all three devices. Any explanation why it won't work with mine?

    "the Middle East" is a really big place. I suspect you bought a gray market hacked phone. Call Apple Care and give them the serial number. Maybe they can tell you if it's locked and to what carrier.

  • I have an Airport Extreme Base Station and have recently upgraded to Mountain Lion. Now airport utility won't work with my base station so I bought a Time Capsule. For the life of me I can't make the substitution work and only see a blinking amber light.

    I have an Airport Extreme Base Station and have recently upgraded to Mountain Lion. Now airport utility won't work with my base station so I bought a Time Capsule. For the life of me I can't make the substitution work and only see a blinking amber light. Can anyone who has made this change offer some advice?

    apikoros wrote:
    The Utility transferred all of the AE's settings, so I still have to change the password, which leaves me with only 2 other questions, I think:
    1)  I assume it's just a matter of using the Utility, entering a stronger password and checking for it to be remembered in Keychain Access.  But do I have to  change the password for each individual unit-- the TC, the Extreme and both Expresses-- or will changing it just for the TC alone work for the entire network?
    Resetting the password you will need to do for each device... the utility cannot even see those old units.
    So you will have to do it for each one.. think it through.. because as you change passwords the others will lose connection.. so start from the express which are wireless extending .. change those first.. and go back up the chain.. as each one changes it will drop off the network.. until you reach extreme and change that. Then you might need to reboot the whole network to get everything talking again. If something goes wrong.. just pluck that one out of the mix and plug in ethernet.. reset and redo the setup. That is my preferred method anyway.. do everything in isolation one by one. By ethernet and then nothing goes wrong.
    2)  Who's the treasonous SOB who spilled the beans to you about the ICBM in my back yard?!?
    N.Korean hackers.
    [Edit] Whoops-- one more question:  I want to partition the TC's disk, but Disk Utility doesn't see it.  What do I need to do?
    You cannot partition a network disk. And apple provided no tools for it in the TC itself. You can pull the disk out and partition it but that voids your warranty. (although done with care who is to know).
    Look at Q3 here.
    http://pondini.org/TM/Time_Capsule.html
    Mixing TM and data on the TC is worth planning carefully. They don't necessarily sit happily together.

  • RoboHelp for Word installed from RoboHelp 10 won't work with Word 2010

    I have a Help project created in RoboHelp for Word 8.  I recently upgraded from Word 2007 to Word 2010 and discovered that RH8 for Word won't work with Word 2010.  So I purchased RoboHelp 10 and have installed RoboHelp for Word from it.  Alas, RH for Word STILL won't work with Word 2010.  When I try to open my project, I get this message:
    Before I bought RH10, I live-chatted with an Adobe sales person who assured me it was compatible with Word 2010.
    BTW, I tried to roll back to Word 2007, but I was getting weird behavior running Word, so I have reinstalled Word 2010 and want to stay there.
    Any ideas?

    I have just installed Rh10 for Word on a new machine and initially I got this message.
    I wonder if you have followed those instuctions? I changed the setting to Enable All.
    The other possibility is what do you have set for the default version? If it is 2007 and that no longer exists on your machine, then Rh will not be able to proceed. The dropdown should show 2010
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Pogo won't play games java won;t work with firefox

    I was playing pogo and it came up to update Java. Did it and now can't play most of the games like canasta. Says java won't work with firefox.....it did before. try for 4 days not and no luck

    Java is working properly. Still not loading games

Maybe you are looking for

  • Making a form where attachments must be included

    Hi I need to make a fillable form where when the person is done they must attach certain files before they can submit the form. I would like a checklist where they tick the box, example Certified ID and they can browse to the file on their computer a

  • Cloning a Microsoft Cluster

    Hi Experts We are planning our Disaster Recovery Plan,  we have some SAP applications which are difficult of install and configure, so we are thinking that our best option is cloning the entire server to the secondary site, we have a tool named doubl

  • HT201210 Missing photos after iOS 6 update on my iphone 4

    After completing the iOS 6 upgrade, everything synced properly to my phone except for my photo albums. Is there a way to recover?

  • "unknow error -42110" What is it?

    When conect my iphone using usb, itunes pop a message of unknow error -42110, what is it? i cannot find any explanation in the forum. I have windows 7, iphone 5 and the last version of Itunes. Thanks

  • Should apple not inform users when an app is no longer supported by its producer?

    I am trying to get wallet working on my desktop, iphone and ipad and have discovered that the app may no longer be supported via comments and posts by reveiwers but there is nothing on the app page within the appstore to indicate if the app is in fac