Quest about a gui i'm trying to make that acts as a shell for  jar command?

I try to create a jar file from a whole directory and the program locks up. It only locks up if there is a another directory inside that directory that is being archived. I added a System.out.println(command) to see if the command being sent is the correct one, and it is.. so there is something going on with the run-time or an exception.. i ran some debugging tests and it seem as if the problem happens at this line of code:
                    child.waitFor();
but if i take that out.. i get another type of exception error which reads...
Exception occurred during event dispatching:
java.lang.IllegalThreadStateException: process has not exited
at java.lang.Win32Process.exitValue(Native Method)
at JarFrame.jarCreate(JarFrame.java:659)
at JarFrame.actionPerformed(JarFrame.java:330)
at java.awt.Button.processActionEvent(Button.java:329)
at java.awt.Button.processEvent(Button.java:302)
at java.awt.Component.dispatchEventImpl(Component.java:2595)
at java.awt.Component.dispatchEvent(Component.java:2499)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:10
3)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
but the program doesn't lock up when this happens... but also at this point no directory at all can be archived... not even one without another directory inside it... the code for the create command is at the bottom... the code at the bottom archives a directory if the directory does not have another directory inside it.. but locks up when there is another directory inside the directory that is being archived... distinguishing if the file to archive is a directory or a file is not problem for the jarCreate() method.. it is at the exception waitfor() where the problem occurs...
PLEASE HELP!
thanks,
DiscoHristo
     /*     Runs the DOS Command for creating a JAR File     */
     public void jarCreate ( )
createFieldText = createField.getText();
String command;
String output = new String ("Jar File Created");
if (createFieldText.endsWith(".jar") == false)
     createFieldText = createFieldText.concat(".jar");
if (selectedDirectory == null)
     command = "jar cvfM " + createFieldText + " " + directoryOfFile + selectedFile;
               Runtime rt = Runtime.getRuntime();
               try
                    Process child = rt.exec(command);
                    child.waitFor();
                    textBox.append(output + '\n');
                    System.out.println("Process exit code is: " + child.exitValue());
               catch(IOException e)
                    System.err.println("IOException starting process!");
               catch(InterruptedException e)
                    System.err.println("Interrupted waiting for process!");
     if (selectedDirectory != null)
          command = "jar cvfM " + createFieldText + " " + selectedDirectory;
          System.out.println(command);
     Runtime rt = Runtime.getRuntime();
               try
                    Process child = rt.exec(command);
                    child.waitFor();
                    textBox.append(output + '\n');
                    System.out.println("Process exit code is: " + child.exitValue());
               catch(IOException e)
                    System.err.println("IOException starting process!");
               catch(InterruptedException e)
                    System.err.println("Interrupted waiting for process!");
     }

Hello,
Documentation says:
The Runtime.exec methods may not work well for special processes on certain native platforms, such as native windowing processes, daemon processes, Win16/DOS processes on Win32, or shell scripts.
Especially "may not work well" means that the behaviour of Runtime.exec is not documented in some "special" cases. Unfortunately I've same problem (unpredictable lock-ups) with Process.waitFor() in "standard environment" (Linux, J2SE 1.4, calling standard shell single processes). Could you be kind enough to let me know if you've found some solution?
Thanks,
Karel

Similar Messages

  • Disk Utility has been trying to make a partition on hard drive for a long time

    Disk Utility has been trying to make a partition on hard drive for a long time, I want to make 2nd partition and install the Snow Leopard on 2nd disk,
    Lion is very slow on my Early 2011 MBP.

    I am using MBP early 2011 with Osx Lion,
    Lion was slow for me and I have no external HD to backup my files,
    Than I want to make 2 partititon of my internal HD to backup my files to it, and also want to install Snow Leopard to that new partition using the CDs comes with my MBP.
    After that.
    I was using Disk Utility to partition my MBP to install Snow Leopard to my second part. While partitioning my Disk Utility did not complete and wouldn't continue the process, I waited about 30 minutes to see if it fix itself, so I cancelled it and restart the Mac, upon rebooting I opened Disk Utility to try again and I noticed I lost 400 gigabytes of space. I tried to "Erasing Free Space" but after a couple of minutes it finished and the same problem 400 GBs of lost space.
    Is there a way to fix this and regain my lost hard drive space?

  • Controllers in the same WISM module in the 6500, i'm trying to make one of them anchor controller for guest internet

    I have 2 controller in the same WISM module and I'm trying to make one of them Anchor controller for guest WLAN, but when I give put the anchor controller in a separated non-routed VLAN and connect it to an outside switch by creating VLAN 192 on the core. ( the Internet router is connected to the same switch).-it is showing path down... ( VLAN 192 visitor Internet and VLAN 224 my internal controller management VLAN are not talking)
    there is no routing between these 2 VLAN ( because of security), but i can't get the controller to communicate.
    -if I connect my laptop to this switch I'm able to go out on Internet but my visitor WLAN is not able to get IP address from the router connected to this switch.
    - I called Cisco and one the guys told me that i can leave the management in VLAN 224 for the controller to communicate ( which they did), but the issue I'm having right now is that my visitors are not getting IP addresses from this VLAN at all
    some one please advise
      vlan192   4/1 vlan 192              int g0/0 192.168.2.201
      6500 ----- switch ---- router---------  (outside)
        |         |   |
        |        DHCP server
       WLC

    A couple of questions, is VLAN 192 allowed across the trunk link to the wlc?  Do you have an interface tagged for vlan 192, with a valid address?  What is providing the DHCP?
    Cheers,
    Steve
    If  this helps you and/or answers your question please mark the question as "answered" and/or rate it, so other users can easily find it.

  • Having lost my password, et al., I obtained a new one successfully, but now when I tried to make a purchase, I was asked for my Security Code. How do I obtain a new one since I have lost all my iPad documentation?

    Having lost my password, et al., I obtained a new one successfully, but now when I tried to make a purchase, I was asked for my Security Code.  How do I obtain a new Security Code since I have lost all my iPad documentation?   Thank you,    Dzurek123

    That refers to the 3 digit security code on the back of your credt card, not a security code for the iPad.

  • Disk Utility has been trying to make a partition on hard drive for 5 hours what happens if I stop it

    I have bee trying to make a partition on my mac Book Pro hard drive with disk utility. It says it is modifying partition map for 6 hours now, What happens if I stop this?

    gaborneo wrote:
    I don't want to erase my whole drive.
    Your only erasing the Free Space of your OS X partition, meaning the areas where there is none of your data stored.
    Because when Bootcamp works it's going to take some from that to create the Bootcamp partiton for Windows.
    If I choose erase does it then give me the option before I press something else and wipe out what I don't want to wipe out just yet?
    If you click Erase Free Space it give s a option and then you go.
    My dvd player is bust and at the moment...
    Well how are you going to install Windows and the drivers?
    You didn't read the Bootcamp manual did you?
    https://www.apple.com/support/bootcamp/
    IMO, your not up to doing this, I advise you to stop and forget about installing Windows, because your problems are only just started.
    Good Luck

  • I'm trying to make a purchase on App store for the first time and I forgot my security questions. What should I do?

    I have set up my apple ID quite some time ago and I don't remember what I answered for my security questions. Can someone help me with how to change them so that I can make my purchase? Thanks

    If you have a rescue email address (an alternate email address is different) on your account then you can use that to reset them : http://support.apple.com/en-us/HT6170
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will have to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/en-us/HT5699
    If your country isn't on that page then try this form and explain and see what they reply with : https://ssl.apple.com/emea/support/itunes/contact.html
    When they've been reset, and if you don't already have a rescue email address, you can then add one for potential future use : http://support.apple.com/en-us/HT201356
    Or if it's available in your country you could change to 2-step verification : http://support.apple.com/en-gb/HT5570

  • HT1343 I am trying to make a html comment tag shortcut for Word documents on my Mac.

    It will be <!--...-->
    I will be using this a lot on my word documents.
    For the life of me, I can't figure out how to do this.
    Can someone please help?

    jlhrch wrote:
    … Do I need different software … ?
    you need a different recording
    there's almost no chance to 'wipe off' a voice from a done, mixed, stereo soundtrack - you would need a multi-track file of the original recording, to switch-off that track.
    What gives some results is - but can not be done in FCPX, perhaps in Logic (ask the experts in the Logic forum):
    change polarity on one stereo channel and mix both channels - if the voice is from 'center', the interference will (almost) mute that. usually, to a singer some reverb is added - which, usually, is stereo - so, this very raw, brutal trick doesn't accomplish the wanted result.-
    Using an Equilizer, filter, etc, will mute too much of the rest of the music ....
    Plan B)
    look to find and purchase a readily-done karaoke version from some source ....

  • How do i deactivate a device through icloud if the device is broken and i am unable to turn on find my iphone? Also i do not own a apple id as ive been using a family members due to problems when trying to make one?

    How do i deactivate a device through icloud if the device is broken and i am unable to turn on find my iphone? Also i do not own a apple id as ive been using a family members due to problems when trying to make one?

    Hey tyjox,
    Thanks for the question. After reviewing your post, it sounds like you need to deactivate Find My iPhone on a device that does not work. You will need to work with the family member of the account the iPhone is registered with. I would recommend that you use this article to help you resolve or isolate the issue.
    iCloud: Remove your device from Find My iPhone
    http://support.apple.com/kb/PH2702
    Remove an iOS device you no longer have
    If you no longer have the iOS device because you gave it away or sold it, you need to remotely erase it before you can remove it.
    Sign in to icloud.com/#find with your Apple ID (the one you use with iCloud).If you’re using another iCloud app, click the app’s name at the top of the iCloud.com window, then click Find My iPhone.
    Click All Devices, then select the device.
    Click Erase [device], then enter your Apple ID password. Because the device isn’t lost, don’t enter a phone number or message.If the device is offline, the remote erase begins the next time it’s online. You’ll receive an email when the device is erased.
    When the device is erased, click Remove from Account.All your content is erased and someone else can now activate the device.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Save for web and devices, .png (trying to make an icon)

    I'm trying to make a 57x57 px .png file for an iPhone icon.  I'm pretty new to Illustrator, but have been watching some videos/tutorials online.  I started with the default Print document, and made my icon that looks ok.  Nothing fancy, just an ellipse, another ellipse inside of it, and some icon inside the two ellipses.  (the two ellipses serve as a ring around my icon).  After creating the ring+icon, I put a colored square behind everything for my background color.  The total size is 382x382.  I created a new Print document to be 57x57.  I copied and pasted everything from the first 382x382 image into the 57x57 file, and shrunk the 382x382 to 57x57.  I then Saved for web and devices, selected PNG 24, no transparency, and I got my image. 
    When I look at my image at this size, it looks pretty bad.  Like even for the ellipse parts, it looks like it's grainy and that there are jaggies.  When I look at other iPhone icons, they just seem so much more smoother and fluid.  Is there something I'm doing wrong with saving or shrinking that I need to take into account for?  Or are there standard stroke sizes that should be used to get a smooth circle?  Thanks!

    The smoothing process is called anti-aliasing. It fills in the border pixels with a shade of gray, giving the illusion of a smooth curved object.
    That being said, keep in mind the smaller in size pixels wise, the harder it is to keep the quality.

  • Trying to make a payment on this site...

    i've been trying to make a payment on my debit card on this website to my horror all has failed... i've been using the same card for all the other payments up to this why are you guys messing up now? please get it together, i've never had this problem before until now!!!

    I've been trying to make a payment as well online for 4 days now. I've sent emails to "support" but no response as of yet. It has nothing to do with debit cards, account balances, etc... It has something to do with their links/ payment gateway as it keeps bouncing me to the top of the page after hitting the "next" botton.

  • I can watch all of my old TV shows on iTunes, but the last one I downloaded jammed up after about one minute.  I tried quitting I-tunes and re-starting my computer to no avail.  iTunes won't even let me delete it so I can try downloading it again.

    I can watch all of my old TV shows on iTunes, but the last one I downloaded jammed up after about one minute.  I tried quitting I-tunes and re-starting my computer to no avail.  iTunes won't even let me delete it so I can try downloading it again. But it will let me delete other episodes.

    This forum is for questions from those managing sites on iTunes U, Apple's service for colleges and universities to post educational material in the iTunes Store. You'll be most likely to get help with this issue if you ask in the general iTunes for Mac forum.
    Regards.

  • Im having trouble with error 13019 I have read the previous discussions about this matter and have tried to do them except for the fact that under the music tab when clicking on my ipod every thing is frozen. It s not my comp. and i dont wish to restore.

    Im having trouble with error 13019 I have read the previous discussions about this matter and have tried to do them except for the fact that under the music tab when clicking on my ipod every thing is frozen. It s not my comp. and i dont wish to restore. Please help!

    If you are wondering why you are not getting any responses, it is because you have vented a complaint without any details that make any sense or give anyone something to work on.
    If you want help, I suggest actually detailing what has happened, with versions of software etc. Anything that would let us assist.
    As a start I am guessing that you have not really got the hang of "How it all works". Firstly download the Pages09_UserGuide.pdf from under the Help menu. Read that and view the Video Tutorials in the same place. A good addition would be the iWork 09 Missing manual book and something to help you learn how to use your Mac.
    If there are specific tasks you need help with:
    http://www.freeforum101.com/iworktipsntrick/index.php?mforum=iworktipsntrick
    Is a good resource.
    Peter

  • My Bluetooth has disappeared and I have tried just about everything on the internet. When I click on Bluetooth file exchange it says hardware not found. I tried resetting everything as well nothing is working for me please help because now my facetim

    My Bluetooth has disappeared and I have tried just about everything on the internet. When I click on Bluetooth file exchange it says hardware not found. I tried resetting everything as well nothing is working for me please help because now my facetime doesn’t work neither does photo booth and now I cannot text people off my laptop unless they have iMessage.

    If you followed the instructions in the support article exactly (leaving the machine off for two minutes), then it has a hardware fault. Take it to an Apple Store or other authorized service provider for repair.

  • Need Information about WEB Gui

    Hi all,
    I need some informatin about web gui. 
    What is it? It's a web application or a internet services or what?
    How can I use it? IT's possible to use it in the enterprise portal?
    thanks
    enzo

    Hello,
    please have a look at https://wiki.sdn.sap.com/wiki/display/HOME/InternetTransactionServer
    Best regards
    Rolf-Martin

  • Hello ive been trying to get this matter token care of for the past 24 hrs and still no help im getting very upset now I paid 100 plus $$ to have this program that isn't even working I would like to speak to someone about on the phone I got a 1800 number

    hello ive been trying to get this matter token care of for the past 24 hrs and still no help im getting very upset now I paid 100 plus $$ to have this program that isn't even working I would like to speak to someone about on the phone I got a 1800 number for tech but everytime I call it hangs up and says to chat........ ive been doing that all day yesterday its kinda getting old telling the same thing over n over again so I would like some real live help a number I can call or someone can call me 402 802 1211 everytime I try to do something on this it ask for my serial num I put it in and it says invalid number and when I do my pics it has trail across them

    Hi,
    I'm sorry to hear that you are having problems but this is a user to user forum and only occasionally visited by Adobe staff. Depending on your version of Photoshop elements, you may be able to get help through the chat sessions starting here
    https://helpx.adobe.com/uk/contact.html?promoid=KLXNA
    If you give us details like your operating system, Photoshop elements version and the problem you ae having, someone may well be able to help you.
    Brian

Maybe you are looking for

  • Can I send multiple photos on one e mail.

    As the title says. Is it possible to send multiple photos on one e mail and if so how? Many thanks.

  • Win 8.1 and ATI Radeon 3650

    Is there a driver for Win 8.1 which allows to use the switchable graphics function? After installing Win 8.1 I just can use the onboard graphic card. The only driver I found is made for Win 7 and doesn't work. A driver for ATI Radeon 3650 is installe

  • [Is it Jdev 11.1.2.4 bug]......LOV issue

    Hi All, Facing a problem related to LOV in Jdev version Jdev 11.1.2.4. Was referring to the solution given by Andrejus here http://andrejusb.blogspot.in/2008/02/list-of-values-component-in-search-and.html. Problem: Migrate the workspace to Jdev 11.1.

  • I have a ipad 2 3g and i cant get the 3g to work

    i have a ipad 2 3g and i cant get the 3g to work

  • Redundant ACS Configuration - IP Address Allocation

    I have remote users that connect to the corporate network via vpn terminating on a VPN3k at the primary site. These users are authenticated and given IP addresses by Cisco Secure ACS. There is a backup site where the backup ACS is deployed. I would l