Results 41 to 46 of 46
- 05-29-2009, 06:22 AM #41
then i'm not too late, that code above should work.
USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
- 05-29-2009, 06:23 AM #42
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
Ok... just made a snap decision.
I would still like to make it work this way, but if I can't, I would at least like to figure out how to start the C++ app and get output to the console for the java app, and how to send it input. Basically just reassign the java console to the C++ app until my C++ app exits. If anyone has some good code for that, I'd love to see it.If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
- 05-29-2009, 06:33 AM #43
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
@ AB nope... your .bat file still doesn't work...
If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
- 05-29-2009, 06:40 AM #44
The Process class has various get...Stream() methods for communicating with the process. You could even use System.setIn()/setOut() to directly plug the console together.
There are plenty of JNI tutorials about. You'd just replace the main method with
where ClassName and MethodName correspond to your Java code.Java Code:JNIEXPORT void JNICALL Java_ClassName_MethodName (JNIEnv *env, jobject obj) { // C++ code }Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
- 05-29-2009, 07:08 AM #45
@Singing Boyo: weird, did you use both code and bat file together as i had it?
USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
- 05-30-2009, 12:39 AM #46
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
weird lol... I just removed my .exe file and replaced it... may have had something to do with the fact that I was copying the exe file from where the C++ compiler put it to the directory of my Java project...
Thanks to all for your help!
Singing BoyoIf the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
Similar Threads
-
error while running jar file created from netbeans
By ecstatic in forum NetBeansReplies: 2Last Post: 03-09-2009, 02:36 AM -
How to stop thread from being jumping off the code without executing it.....
By chiragkini in forum Threads and SynchronizationReplies: 6Last Post: 01-22-2009, 03:38 AM -
How to find file created date.....
By roshithmca in forum Advanced JavaReplies: 1Last Post: 02-18-2008, 09:48 AM -
Executing Ant code pragramatically
By MikeO in forum Advanced JavaReplies: 0Last Post: 07-24-2007, 09:34 PM -
Executing a jar file
By peiceonly in forum New To JavaReplies: 2Last Post: 04-06-2007, 02:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks