How to use wait.for() /wait() commands for MAC? Not working...

I am trying to run an external application on mac using runtime.exec() and it runs fine but after it runs it suddenly terminates the program. I have a waitFor() command after the runtime.exec() waiting for that program to end. If i comment out the waitFor() then the program terminates by going through the run command. The waitFor() worked fine for PC but doesnt work for MAC... anyone know what i did wrong or alternative way of listening for it? thanks!

On the PC i have the following:
Process p = Runtime.getRuntime().exec("C:\\program Files\\QuickTime\\QuickTimePlayer.exe "
+file.getPath());
p.waitFor();
It basically creates a process of QuicktimePlayer and runs the file specified. I then have p.waitFor() used to wait for the user to close the application so i can do listener stuff for it- it worked for PC.
On Mac
String b= "open"+ tempFile.getPath();
Process p= Runtime.getRuntime().exec(b);
System.out.println("before wait");
p.waitFor(); .
System.out.println("app. terminated");
output:*
"before wait".
Program terminates before System.out.println("app. terminated"); but the application (quicktime) starts.
if I do this:
String b= "open"+ tempFile.getPath();
Process p= Runtime.getRuntime().exec(b);
System.out.println("before wait");
// p.waitFor(); .
System.out.println("app. terminated");
output:*
before wait
app.terminated
program terminates "normally" and I see "app.terminated".
I used Eclipse so the "red square" turns red when running it and suddenly grays out when the player appears. So to me the program terminated before the p.waitFor(); If i commented out p.waitFor() then the program goes to the System.out statement and everything goes "fine". I tried using thread.wait(), this.wait() p.wait() etc. but i get errors saying they are not owner of the thread.
hope this helps. thanks

Similar Messages

  • Skype 6.3 upgrade for Mac not working

    [Topic title updated by moderator to be more descriptive. Original topic title was: "Skype upgrade for Mac not working"]
    BE WARNED - just because you are being asked to upgrade your Skype, it does not mean it will work on your machine. I am a fairly regular user of Skype and this morning was unable to log-in, being told that I needed to upgrade. I did so to 6.3.0.602 but I was unable to log-in once the software had downloaded. After some research on the forums and finally a text chat with Support, I was told that Skype 6.3.0.602 requires a Mac OSX of 10.9 or above - I have 10.5.8
    "So what can I do", I asked the tech support. The answer is nothing (unless I get new OS X software) - there is no Skype software programme that supports my operating system and no timeframe for when it might be available.
    Huh? That's right. It's just not available. So for now, users with less than OS X 10.9 will be unable to use Skype when they are instructed to upgrade. It really doesn't make sense. But just so you know....

    jessicaed wrote:
    BE WARNED - just because you are being asked to upgrade your Skype, it does not mean it will work on your machine. I am a fairly regular user of Skype and this morning was unable to log-in, being told that I needed to upgrade. I did so to 6.3.0.602 but I was unable to log-in once the software had downloaded. After some research on the forums and finally a text chat with Support, I was told that Skype 6.3.0.602 requires a Mac OSX of 10.9 or above - I have 10.5.8
    "So what can I do", I asked the tech support. The answer is nothing (unless I get new OS X software) - there is no Skype software programme that supports my operating system and no timeframe for when it might be available.
    Huh? That's right. It's just not available. So for now, users with less than OS X 10.9 will be unable to use Skype when they are instructed to upgrade. It really doesn't make sense. But just so you know....
    Please look at the top of the community page, and you will find a box "Search:". Write your problem here "Upgrade not working" and see what crops up. Most likely you will be taken somewher like here: http://community.skype.com/t5/Mac/quot-We-ve-signed-you-out-because-your-using-an-outdated-version/m...  
    Here you will read that the latest versions of Skype will not work on some of the versions of MacOS, and that PPC requires one version, Leopard another, Snow leopard another, Mountain Lion another. They are indoctrinated with a stamp in their forehead to enforce their congregation of true believers to install the latest with all "security fixes" or death is looming. They are not used to software that is 2 years old. 
    So, with Mac, we have different operating systems and different sets of libraries - and things may go belly up if you upgrade - a OS feature is done differently, a libary has been placed inside the OS, and is no longer needed - and if you try to use it, you will be trapped.
    Install the latest version that works for your Mac, and make sure to freeze this. Update the "info.plist" file and tell Skype that you use their latest should they pry. As long as it works, do not change anything!
    And make the change to stop Skype from checking every time you start.

  • Default them for Mac not working firefox 4 beta 1

    Default them for Mac not working Firefox 4 beta 1
    == This happened ==
    Every time Firefox opened
    == I first opend FF4 beta 1 for the first time

    '''Ritrup''':
    Create a new profile as a test to check if your current profile is causing the problems
    See [[Basic Troubleshooting#Make_a_new_profile|Basic Troubleshooting: Make a new profile]]
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins"
    If that new profile works then you can transfer some files from the old profile to that new profile (be careful not to copy corrupted files)
    See http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Lion and Winzip for mac not working

    Just upgraded to Lion and Winzip for mac no longer functions any suggestions to fix or workaround?

    Any special reason for using WinZip for MAc ?
    In need of compatibility with Windows PCs ?
    YemuZip http://www.macupdate.com/app/mac/12350/yemuzip is freeware.
    Others to be found/tried http://www.macupdate.com/find/mac/zip
    Stefan

  • Office for Mac not working with 10.5.8

    I upgraded to Mac 10.5.8, but neither my 2004 Office for Mac not Acrobat 5.0 are functioning properly. Should I uninstall and reinstall or do I need to upgrade?

    You need Acrobat 7.1
    Is your Office 2004 up to date?

  • Where can I find a detailed tutorial on how to use iTunes for Mac?

    I need to get a really good tutorial on iTunes for Mac 12.0.1.26.
    I am really hung up on being able to download artwork for 2 Albums that I have recently purchased. I have been using Macs  since the 128K Classic. However I never got into using iTunes until just now with version 12.0.1.
    Any help appreciated.
    -Joe

    Right click > Get album artwork...
    Right click where??

  • JSP demo PTS included with Oracle 9i Developer Release for Mac not working

    Hello all, please pardon my ignorance, but I am an Oracle DBA not a JSP programmer.
    I have installed Oracle 9i developer release for Mac OSX and it included a demo application in JSP called pts.
    I followed all the instruction and it still doesn't seem to work.
    When I try to login to the application I get the following exception:
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 3 in the jsp file: /oradev/pts/solmktinit.inc
    Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] /usr/local/jakarta-tomcat-4.1.24/work/Standalone/localhost/_/oradev/pts/login_jsp.java:7: cannot resolve symbol
    [javac] symbol : class DBAccess
    [javac] location: package pts
    [javac] import oradev.pts.DBAccess;
    I'm not sure what this means or how to fix it. I'm sure it's something simple like modifying my classpath or something, but, as I said, I don't know where to begin.
    Any assistance or suggestions would be greatly appreciated.

    Can't you just use the 10g client ?
    I have not tested the 9i dev. with oci calls but I would not be surprised if you try this on tiger. That won't work AFAIK.
    regards,
    Ronald.
    http://homepage.mac.com/ik_zelf/oracle

  • Microsoft Remote Desktop Connection Client for Mac Not Working

    I recently purchased Office 2011 for Mac.  I work at home on my Mac at work on Windows 7.  I also have a work laptop, running Windows 7, that comes home with me.  My goal is to RDC my Mac to the laptop running Windows 7 to reduce desktop clutter, and easily work between machines. 
    I CAN NOT FIGURE OUT how to get Microsoft RDC:mac to connect to my pc. 
    I know that the pc allows remote desktop connections because I often use RDC at work from PC to PC.
    SOME PLEASE HELP!  I have spent hours and hours trying to figure this out and I think it is the time capsule that is causing the problem. 
    My research has found that I have to use port 3389 to get this done.  I am pretty computer savy but when it comes to networking I guess I have no clue.  I have tried just about everything a and can't figure it out. 
    Thanks to anyone that can dedicate some time to configureing my time capsule to allow for RDC.

    I cannot quite put together your whole network..
    I work at home on my Mac at work on Windows 7.  I also have a work laptop, running Windows 7, that comes home with me.  My goal is to RDC my Mac to the laptop running Windows 7 to reduce desktop clutter, and easily work between machines.   
    So this is in local lan.. the PC laptop running win7 and the Mac loaded with RDC software. If this is local lan then the issue is nothing to do with TC.
    That is only if you are trying to connect from work. to home through the router at work and TC at home. On local lan there is no blocking to ports. Are you using the local network IP of the PC Laptop?
    Explain a bit further as it needs a bit more clarification.

  • WD My Passport for Mac not working in Yosemite

    I have been using WD My Passport for Mac with my Mac Book Air for a few years. I suddenly found that my MBA cannot recognise my WD any more. I have searched WD site and was told that it should be the OS problem. I couldn't find similar question in apple community and even worst I couldn't find way to submit this problem to apple.
    Is there any one facing similar problem? If so, please advise how to solve it or at least advise me how I can report the problem to apple. It seems to me that the WD is no longer compatible with the latest Mac OS.
    Thanks for help in advance.

    I would disconnect the drive then restart the Mac in safe mode then do a restart normally.     OS X: What is Safe Boot, Safe Mode? - Apple Support
    This can solve some problems and is simple to do. If it still persists the best next step would be to connect the ext HDD to another Mac and see if it works. If it does not then suspect the drive has issues.

  • Office for mac not working for all users after migration

    Recently purchased macbook retina display and used migration assistant to move everything over from a macbook pro 17" (late 2011). After the migration my login (admin rights) has no problem on the new macbook, but my wife login cannot use the Office for Mac without being asked to do an install.
    Problem is, the version we have goes through the install and then asks to 'register' the product and the version is no longer supported so you cannot register, therefor the program will not run.
    Am I missing something here? Everything still works on both of our sign in's on the old macbook pro, and on the new macbook retina, office works on my sign in only.
    The original install was a download version, so there are no 'disks' to do a re-install.
    Any suggestions?

    You need Acrobat 7.1
    Is your Office 2004 up to date?

  • Kindle for Mac not working at all on my MBP.

    Have Snow Loepard installed. Kindle always used to work. Suddenly, one day, after OSX update no longer worked. Mac and Amazon don't even recognize a fresh install of kindle for mac. A line of question marks in the center of the kindle page. Weird. I called Amazon over a week ago about the issue. Still no response, though I was told some people were having similar issues. Anyone else experiencing this with Kindle for Mac?

    https://discussions.apple.com/thread/3200518?start=0&tstart=0
    According to the guys in this forum, the correct answer is not the correct answer.  The actual correct answer is to follow the steps outlined to uninstall the Kindle program from your computer (Do not use Clean My Mac).  Then, redownload the program through the Apple App Store (NOT Amazon), and you should be good.  It seems there's a discrepency between the coding of the program in the App Store and the actual program off of Amazon's website that the actual program off of Amazon's website doesn't account for with Lion.
    Hope that works for you guys- spread the word to all the other 100 forums about Kindle if it does.

  • Logitech Quick Cam Vision Pro for Mac not working in iChat.

    Whenever I try to use iChat with my Logitech camera i get either a message saying "there is no camera attached" or "another program is using the camera". Rebooting helps for a while and it will work, but if I open Preferences then the problem arises again. Unplugging the camera and replacing it is no help - even bypassing a hub and plugging directly into the computer. The audio works fine and the mic choice is the camera's - no problem. Skype video also works perfectly. This seems to be a problem ever since I upgraded to Snow Leopard - I never had this problem before.

    Hi,
    Prior USB 2.0 and UVC compliant Cameras there has always been problems with Logitech cameras and their Drivers.
    There were two third party Drivers for Macs that could be used and the iUSBCam utility.
    However Broadly speaking UVC compliant cameras working over USB 2.0 and Snow Leopard have seen iUSBCam fall in to the Unsupported on Leopard group.
    It seems that some of the Pro variants of Logitech cameras are still having issues with the Mac OS in Snow Leopard.
    The Windows Vista Driver for UVC is/was fairly feature rich in what you could adjust/access about the camera settings.
    The Mac version implemented at OS 10.4.9 is less frilly.
    Some cameras are 1.3mp but ichat only uses a max of 640 X 480 pixels pics (0.3Mp) and it is unlcear if some cameras will allow this to work smoothly.
    I would also try a PRAM reset.
    Shut down the computer.
    Restart it holding down APPLE(or ⌘)ALT+PR Keys until you have heard three Start Up Bongs.
    This may reset things further/deeper than a reboot does.
    Based on historical evidence I would suspect the camera's side of the UVC implementation not allowing a proper step down to lower pixel sampling.
    Of Course it could be the way Snow Leopard does this or the UVC driver in itself (although both seem to work with other makes of cameras)
    9:38 PM Friday; January 8, 2010
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

  • 4G for Mac not working per other thread instructions

    Hi, Just got a 4G Pantec UMP290. I am trying to connect in an area that has 3G confirmed, but does NOT have 4g service. a) I successfully activated and used the modem on a windows machine (not via parallels) using the VZW Access Manager. I got 2 bars of 3g detected by the verizon windows software and was able to browse the net. b) I followed the instructions located here: http://www.evdoinfo.com/content/view/3479/63/ and here: http://community.vzw.com/t5/4G-Discussion/4G-for-mac/td-p/342990 c) When I hit connect I get a "No phone service detected. Check your phone line and try reconnecting" d) Can anyone please help? Is there some other sort of setting for connecting to a 3g network?

    The instructions you refer to only permit access via 4G.  I've not seen anything posted yet that allows the Mac to access 3G via the Pantech modem.

  • Itunes 7.1.1 for mac not working

    i updated to 7.1.1. and when i open itunes, it freezes up. no error message or unexpectedly quit msg, i just see the menu at the top, but can't do anything and have to force quit. is there a way to uninstall itunes on osx and re-install an older version?

    Ever since I updated to iTunes 7.1.1(5) for Mac I've had nothing but problems in my attempts to launch the program. Neither the shortcut in my Doc nor the main listing under "Apps" would launch the program; all I got was a wonderful "This program failed to launch" prompt.
    Two big things I've learned when it comes to iTunes: do not download updates 1) immediately and 2) from "Automatic Updates." Something about going via "Apple > Software Update..." causes my system to crap out when performing iTunes updates. My suggestion is to download the latest release from Apple.com and then install. Additionally, iTunes 7.1.1(5) corrupts your "iTunes Music Library.xml" file.
    Thankfully, ever since iTunes 4.7.1, I've become overly cautious and I create duplicates of my Music Library, which made this process much easier (with far less screaming) than it might have been.
    First, drag anything "iTunes" related from User/Library/Preferences to the trash (i.e. com.apple.iTunes.eq.plist, com.apple.iTunes.plist, com.apple.iTunesHelper.plist)
    Second, drag any shortcuts for iTunes into the trash and drag the master iTunes link listed under "Applications" into the trash as well.
    Third, make a duplicate of both your iTunes Library and iTunes Music Library.xml (which are most likely located at User/Music/iTunes) and move the originals to a different directory, such as up one level to your "Music" folder or to the desktop. This is important because after you reinstall iTunes, there's a very good chance your iTunes Library will become corrupted, not find all of your tunes, and over-write your original XML file and cause all kinds of badness.
    Fourth, if you can get your hands on a copy of iTunes 7.0.2 you should install that first. If you want to continue on, go ahead and install 7.1.1(5), but use the version you can download off Apple.com.
    After I did all of this, I was finally able to open a fresh copy of iTunes 7.1.1(5), which created a brand new iTunes Library and iTunes Music Library.xml and reset all of my preferences. After this successful launch, I then quit iTunes, dragged the new iTunes Library file to the trash, and placed a known, good duplicate of my original iTunes Library back into the User/Music/iTunes directory (which, of course, was renamed "iTunes Library" after deleting the "copy" part).
    Launching the fresh install of iTunes 7.1.1(5) a second time with my original (undamaged) iTunes Library gave me back all of my playlists, play counts, etc.
    What a friggin' nightmare.
    PowerMac G4 Dual 1.25GHz   Mac OS X (10.3.9)  

  • Office for Mac not working

    After installing Lion, I can no longer open Office for Mac 2004. Went to Apple store when I inquired, they said to update Windows. But it won't open at all. Whats next?

    There are lots of reports of that here, and perhaps the Apple Store meant to say upgrade Office for Mac 2004  to Office 2011. If cost is a factor, perhaps iWork would work for ya. Pages is very good and saves files out in word format that others can open, say on a PC. The reason I recommend this is for the Version features of iWork apps, which writers have wanted for a long time, and now we do!
    Cheers,
    coocoo

  • Big problem - Sony Bridge for Mac not working

    About Sony Bridge for Mac, on my Mac OS X 10.8.4 system always stops responding in the "Retrieving Xperia information" stage. Then the system memory footprint up to 5.42G. I do not know why, but I do not believe this is a Sony product. Has now led me to the Mac system completely unable to sync my Xperia Z Ultra phones. My Sony Bridge for Mac version 3.4 . Both came with the phone or from the official website to download a version , are the fault persists . Please give a solution.

    Could you please send me your details in a PM, and I will forward this.
    Make a relevant topic and include the following.
    Name:
    E-mail:
    Country:
    Operator:
    Product(s):
    IMEI nr:
    Build number:
     - Community Manager Sony Xperia Support Forum
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

Maybe you are looking for