ProcessBuilder is FUNKY! or is it just me?
I'm trying to run a JAR file in a ProcessBuilder object. my JAR file accepts command line parameters. However, as soon as I start passing it the parameters of the program hangs or does not do anything. Here is my code:
String list[] = {"java","-jar \\program\\java\\update\\CMDLineUpdateDD1.jar -c \\program\\java\\update\\config.xml"};
ProcessBuilder b = new ProcessBuilder(list);
Process p = b.start();
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line=null;
while((line=input.readLine()) != null) {
log.info(line);
}
int exitVal = p.waitFor();
What happens is that it works when I just 'java' and "-jar" settings. " However, this pot accepts also a few parameters of command line similar to the one shown above. If I add one of these parameters, the program runs nothing. It ends normally, but no program has been run.I tried the above variable 'list' in the following way:
//all parameters completely separated...
String list[] = {"java","-jar","\\program\\java\\update\\CMDLineUpdateDD1.jar","-c","\\program\\java\\update\\config.xml"};
//separated by parameter, with equal signs...
String list[] = {"java","-jar=\\program\\java\\update\\CMDLineUpdateDD1.jar","-c=\\program\\java\\update\\config.xml"};
//parameters with spaces
String list[] = {"java","-jar \\program\\java\\update\\CMDLineUpdateDD1.jar","-c \\program\\java\\update\\config.xml"};
in each case, it takes the "java" command and the "jar" parameter, but once I add the "-c" parameter it is unresponsive.any ideas? Thank you!
Edited by: 960093 Sep 26, 2012 08:08
960093 wrote:
It locks.
THEN MANAGE STDERR AND STDOUT! The main cause of blocking using Runtime.exec () or ProcessBuilder does not stderr.
In your other thread, you received a link to the article "Pitfalls", but you don't seem to have taken well advised of it.
Tags: Java
Similar Questions
-
I did a bit of investigation on it. Here are the facts:
(1) I use Apple Contacts.app to synchronize with Google contacts.
(2) I have two computers, a MacBook Air 2013 and an iMac late 2012, the two 10.11.2 running. With respect to the mail, contacts, calendar, etc., they are configured identically.
(3) I had this problem (among others) for the upgrade on my iMac 2012, so I did a clean install of 10.11.
(4) this problem occurs ONLY on the iMac (again, same configuration on both machines).
(5) I removed the plist and all other data in/application Support and restarted several times related to the contacts.app. No dice.
(6) I repaired disk permissions. No dice.
Review of the console, this is the error message (followed by multiple attempts failed in the same process)
25/01/16 2:34:34.000 PM kernel [0]: sandbox: com.apple.Addres (564) deny (1) / private/var/run/mDNSResponder network-outgoing
My best guess that sandboxing OS x system is denied access to the demon DNS resolver by com.apple.AddressBook service, seeking to talk with Google at any time any changes.
So here's my question: anyone know how I can ask the system to sandbox of chill out on these queries and continues to deny access to the network? Is there a text file somewhere that I can change to provide permissions for com.apple.AddressBook?
And also, is it not funky how he's just on a single computer, both with the same configuration in system preferences?
PS - No firewall is enabled on each machine.
-
How can just write normal text in Flash CC take up to 21 KB when making a swf?
As the title says, I have a flashfile im working on, a banner. I noticed that the size makes a huge leap when I added a text box (just added the text, no animation and dynamics, etc.). So I tried to write the same line of text in a vacuum flashfile, and he went from 0 to 21kb. There must be something wrong, this can't be right. I'm also using Myriad Pro, so no funky crazy fonts. Fonts have always been a knockout 1-3, so that you can understand my dilemma.
Is there some sort of setting that I can play with? From what I see, I don't have any parameters to tell the police to be shipped or simular.
I REALLY need help with this problem.
THX
I actually managed to fix, but it took some time to understand:
I had the "Select" button enabled, so all the text carried in the swf file. When I removed that, I finally got the size.
-
The screen add people faces a (~ 1600) much just show as squares of white, grey
Hello
I was going through my photo library (running 2.0 on Sierra Photos) cleaning and marking of the people. I got far just about every face on the left is a square white, gray. If I add this person, the area where the image would be just rotates the circle of progress.
Any idea on what is happening? I really miss the ability in iPhoto in order to have a Smart Album based on a photograph with a person "without name".
Thank you, Tim
That is a disused here bug that if you click on the x to remove a face, you end up with a tile empty - I hope that this will be fixed in a future Apple 9tell on the bug to improve its priority - http://www.apple.com/feedback/photos.html of output) and I hope that the patch will fix these old problems as well as properly - not advancing It is better to stop the removal of the faces until this problem is corrected
LN
-
I restared my Iphone 7 more because I tried to update 10.0.2 and just before it turned off my entire screen turned stripes gray and white goes horzitonally on the screen then powered back and its been working fine since. I tried this on an Iphone 6s and he did the same so, the iPhone was in version 10.0.2. Can someone tell me if this has happened to you? Try to restart your phone to see if it happens. If you have an iPhone 7, you must hold down the power button and the volume at the same time as the home button is virtual now.
This happened to me on my Mini 4 and my iPhone 6. Both of them work fine, but I noticed the same problem that you have indeed. Must be a bug in iOS 10.
-
Just got the new iPhone 7 & when I transfer iphone 6 iPhone 7, my music has arisen on the phone, but none of my music is available offline, try to understand how I can download all at once for use offline, without having to enter each individual album and click the cloud. I have a lot of music on my phone, would take me forever to individually download each album one by one for offline use.
I have both bought albums/songs itunes and also many of the monthly music apple package. In any case for all it all at once?
Hello
You must use the same identifier apple
Go down homepage itunes page where it says more about this music bought to display
And download
For music apple if its does not sign of apple ID then sign.
See you soon
Brian
-
Where are the options of the trackpad in Sierra OS? In El Capitan the trackpad there NO light tap (ENTER) and just one click HARD (ENTER) and could move the cursor.
System Preferences > Trackpad!
-
Today, I updated for Sierra and updated to the latest version of the Pages. Now I find that I am more able to select a line of text. When I try to do, I find myself with an insertion point where I stopped by selecting, but nothing is selected. This is a bug in the new version of pages or get my wrong settings?
You use a Wacom tablet by chance?
Solution: Press the shift key, just before stop selection. And Yes, that sounds like trouble in the Sierra.
-
My computer tells me every day to update the Pages, but when I go to the App store (where I bought it) and click on update, I just get a spinning wheel.
The specific version of Mac OS X (Apple logo: about this Mac) and version specific Pages (Pages: pages) will prevent us from guess.
-
How to change places in the 10 iOS?
and I think that he just took a dagger blow to where I was (Vancouver)
Hello
You can change the location of your photos to the photo App Mac.
-
I have someone just showed about 100 pictures of my iPad. Now, the pictures are missing, and the "recently deleted" folder is also empty. What can I do?
Have you done something after their show.
-
Just upgraded to MAC OS Sierra and quicken essentials is not compatible. Have the financial years and news of tax which must be consulted. Any help is appreciated.
Return to your operating system previous (it was all saved right?), move the data and Quicken Essentials to a computer running a compatible version of Mac OS X or install a new version of Quicken.
TT2
-
MY iPhone 7 won't let me push down on the icons to move them. When I push it down and that you hold, no matter how many seconds the icon itself appears just. Help!
Push slightly, not difficult.
-
Just updated to IOS 10.0.2 and unable to connect using Store.Please App!
Just updated to IOS 10.0.2 and unable to connect using Store.Please App!
Harry
Hello
Go down to itunes apple ID page homepage remove ID, then reconnect again.
See you soon
Brian
-
My iPhone 7 does not sound it just vibrates?
Just picked up my new iPhone 7 last night. When I get a call it just vibrates and has no audible ring. The Bell Rings when I test it and the volume is high. It downloaded all my settings from my old iPhone 5 in the cloud. How can I fix this please?
Have you checked the key "secret" along the edge, close the external volume controls? Orange = mute.
Maybe you are looking for
-
HP Notebook 2000 2d00SM: password BIOS [HELP]
Hello! A few days ago, I tried to access my BIOS setup. But he asks me a password. I tried Google, but all have failed. Please, can you help me. Code is: 81570787. Thank you in the future!
-
Dynamic release of variable size of dispatch class method array on FPGA
I have a parent on the FPGA class that will serve as a model/framework for future code which is developed. I had planned on creating a class of the child and by substituting a few methods. The child class constant would have fallen on the schema so t
-
Applications for Smartphones blackBerry "BOLD"
I just got my "BOLD" today w / ATT and wondering are the little extra I guess they're called applications for free? [I have the plan personal data] so things like ATT Navigator, mobile MEdia Net, CV, yellowpages.com. etc etc.
-
Hello I can't download the driver for the printer hp psc 2355 for windows 7. could you please help me solve this problem? Thank you very much in advance, Rosamond
-
Is anyone out there?