The Wayback Machine - https://web.archive.org/web/20161108074432/http://www.codeproject.com/Messages/4973762/Start-java-program-from-Objective-C-code.aspx
Click here to Skip to main content
12,576,539 members (59,141 online)

Objective-C and Swift

 
QuestionSimultaneous Microphone Access on iPhonePin
Member 123773388-Mar-16 1:35
memberMember 123773388-Mar-16 1:35 
QuestionMessage Automatically RemovedPin
7-Jan-16 17:26
memberwegag48w37-Jan-16 17:26 
QuestionObjective C first program from the book, warning messagesPin
Member 1212858510-Nov-15 2:44
memberMember 1212858510-Nov-15 2:44 
AnswerRe: Objective C first program from the book, warning messagesPin
BharathReddy V12-Jan-16 3:04
memberBharathReddy V12-Jan-16 3:04 
QuestionLinker command failed with exit code 1 (use -v to see invocation) in xcode 5.1.1Pin
Member 1198376314-Sep-15 11:17
memberMember 1198376314-Sep-15 11:17 
QuestionImagePickerController image sizePin
liel333-Aug-15 12:30
memberliel333-Aug-15 12:30 
QuestioniOS XMPP received message in coversation screenPin
Member 1176696715-Jun-15 3:37
memberMember 1176696715-Jun-15 3:37 
SuggestionRe: iOS XMPP received message in coversation screenPin
Richard MacCutchan15-Jun-15 5:19
protectorRichard MacCutchan15-Jun-15 5:19 
GeneralRe: iOS XMPP received message in coversation screenPin
Member 1176696715-Jun-15 21:42
memberMember 1176696715-Jun-15 21:42 
AnswerRe: iOS XMPP received message in coversation screenPin
Dennis E White17-Jun-15 6:54
professionalDennis E White17-Jun-15 6:54 
Questionmake a system monitor using obj c.Pin
Member 116779679-May-15 14:00
memberMember 116779679-May-15 14:00 
AnswerRe: make a system monitor using obj c.Pin
Richard MacCutchan9-May-15 22:10
protectorRichard MacCutchan9-May-15 22:10 
GeneralRe: make a system monitor using obj c.Pin
Dennis E White15-May-15 6:25
professionalDennis E White15-May-15 6:25 
GeneralRe: make a system monitor using obj c.Pin
Richard MacCutchan15-May-15 6:41
protectorRichard MacCutchan15-May-15 6:41 
GeneralRe: make a system monitor using obj c.Pin
Dennis E White15-May-15 7:04
professionalDennis E White15-May-15 7:04 
GeneralApp that converts human years to dog yearsPin
Member 115920608-Apr-15 16:44
memberMember 115920608-Apr-15 16:44 
GeneralRe: App that converts human years to dog yearsPin
Dennis E White11-Apr-15 10:34
professionalDennis E White11-Apr-15 10:34 
GeneralRe: App that converts human years to dog yearsPin
Richard MacCutchan11-Apr-15 23:05
protectorRichard MacCutchan11-Apr-15 23:05 
GeneralRe: App that converts human years to dog yearsPin
Dennis E White13-Apr-15 11:09
professionalDennis E White13-Apr-15 11:09 
QuestionCan anyone help me solve this project?Pin
Member 115772012-Apr-15 14:46
memberMember 115772012-Apr-15 14:46 
AnswerRe: Can anyone help me solve this project?Pin
Sascha Lefévre2-Apr-15 15:23
memberSascha Lefévre2-Apr-15 15:23 
AnswerRe: Can anyone help me solve this project?Pin
Dennis E White11-Apr-15 10:32
professionalDennis E White11-Apr-15 10:32 
AnswerRe: Can anyone help me solve this project?Pin
Peter Webb5-May-15 4:30
memberPeter Webb5-May-15 4:30 
QuestionLaunch Safari from another app then Autofill username and passwordPin
picardy8-Jan-15 9:45
memberpicardy8-Jan-15 9:45 
AnswerRe: Launch Safari from another app then Autofill username and passwordPin
Dennis E White27-Jan-15 6:11
professionalDennis E White27-Jan-15 6:11 
AnswerRe: Launch Safari from another app then Autofill username and passwordPin
C3D130-Jan-15 4:46
professionalC3D130-Jan-15 4:46 
QuestionStart java program from Objective C codePin
Member 113539195-Jan-15 9:42
memberMember 113539195-Jan-15 9:42 
I'm trying to make a pretty simple frontend program that's able to start up a java program when it's run, but haven't yet mastered OC. Someone suggested that I try using a console command (code below), but I haven't been able to make that work yet.

Is there an easier way to do this, or does any one here know where my code has gone wrong?

int main(int argc, constchar * argv[]) {   NSFileManager *filemgr; NSString *currentpath;   filemgr = [[NSFileManager alloc] init];   currentpath = [filemgr currentDirectoryPath];   NSPipe *pipe = [NSPipe pipe]; NSFileHandle *file = pipe.fileHandleForReading;   NSTask *task = [[NSTask alloc] init]; task.launchPath = [currentpath stringByAppendingString:@"/java"]; task.arguments = @[@"-jar", @"PolyGlot.jar"], [NSString stringWithFormat:@"%c", argv]]; task.standardOutput = pipe;   [task launch];   NSData *data = [file readDataToEndOfFile]; [file closeFile];   NSString *grepOutput = [[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding]; NSLog (@"grep returned:\n%@", grepOutput);   return0; }

When I run this, I get the error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'launch path not accessible'

I know that the current path is accessible, though... so I'm kind of stumped here. Any help would be much appreciated. Thanks!
AnswerRe: Start java program from Objective C codePin
jschell5-Jan-15 10:37
memberjschell5-Jan-15 10:37 
GeneralRe: Start java program from Objective C codePin
Member 113539195-Jan-15 10:52
memberMember 113539195-Jan-15 10:52 
AnswerRe: Start java program from Objective C codePin
Richard MacCutchan5-Jan-15 23:39
protectorRichard MacCutchan5-Jan-15 23:39 
GeneralRe: Start java program from Objective C codePin
DraqueD6-Jan-15 6:04
memberDraqueD6-Jan-15 6:04 
GeneralRe: Start java program from Objective C codePin
Richard MacCutchan6-Jan-15 6:29
protectorRichard MacCutchan6-Jan-15 6:29 
GeneralRe: Start java program from Objective C codePin
DraqueD6-Jan-15 6:43
memberDraqueD6-Jan-15 6:43 
GeneralRe: Start java program from Objective C codePin
Richard MacCutchan6-Jan-15 7:29
protectorRichard MacCutchan6-Jan-15 7:29 
GeneralRe: Start java program from Objective C codePin
DraqueD6-Jan-15 10:29
memberDraqueD6-Jan-15 10:29 
AnswerRe: Start java program from Objective C codePin
seemajoshii27-Feb-15 2:22
memberseemajoshii27-Feb-15 2:22 
QuestionHow do I find Objective C developers?Pin
Waffleapp13-Dec-14 8:13
memberWaffleapp13-Dec-14 8:13 
QuestionIn objective-c I’m try to create a statement that toggles a variablePin
Member 1125124020-Nov-14 12:02
memberMember 1125124020-Nov-14 12:02 
AnswerRe: In objective-c I’m try to create a statement that toggles a variablePin
Richard MacCutchan20-Nov-14 22:56
protectorRichard MacCutchan20-Nov-14 22:56 
QuestionDifference between C and Objective-CPin
online visit9-Jun-14 20:32
grouponline visit9-Jun-14 20:32 
AnswerRe: Difference between C and Objective-CPin
future20159-Jun-14 21:57
memberfuture20159-Jun-14 21:57 
GeneralRe: Difference between C and Objective-CPin
online visit9-Jun-14 22:31
grouponline visit9-Jun-14 22:31 
AnswerRe: Difference between C and Objective-CPin
Richard MacCutchan9-Jun-14 22:00
protectorRichard MacCutchan9-Jun-14 22:00 
GeneralRe: Difference between C and Objective-CPin
thatraja10-Jun-14 22:11
protectorthatraja10-Jun-14 22:11 
GeneralRe: Difference between C and Objective-CPin
Richard MacCutchan10-Jun-14 22:28
protectorRichard MacCutchan10-Jun-14 22:28 
GeneralRe: Difference between C and Objective-CPin
thatraja10-Jun-14 22:42
protectorthatraja10-Jun-14 22:42 
GeneralRe: Difference between C and Objective-CPin
Dennis E White11-Jun-14 5:24
memberDennis E White11-Jun-14 5:24 
GeneralRe: Difference between C and Objective-CPin
Richard MacCutchan11-Jun-14 6:53
protectorRichard MacCutchan11-Jun-14 6:53 
AnswerRe: Difference between C and Objective-CPin
Dennis E White11-Jun-14 5:22
memberDennis E White11-Jun-14 5:22 
GeneralRe: Difference between C and Objective-CPin
Manikandan1011-Jun-14 18:31
professionalManikandan1011-Jun-14 18:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.161101.1 | Last Updated 8 Mar 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

close