Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Java from VC++

Reply
Thread Tools

Java from VC++

 
 
ToSam
Guest
Posts: n/a
 
      01-31-2005
I am writing a VC++ program that has to fetch a Java source file,
compile it with a Java compiler, execute it at runtime, and return the
result objects back to VC++. Do you know of any sample codes to
illustrate how that works, or any suggestions?
 
Reply With Quote
 
 
 
 
msalters
Guest
Posts: n/a
 
      01-31-2005

ToSam wrote:
> I am writing a VC++ program that has to fetch a Java source file,
> compile it with a Java compiler, execute it at runtime, and return

the
> result objects back to VC++. Do you know of any sample codes to
> illustrate how that works, or any suggestions?


There are some things that you can actually do in C++ (fetch a file,
probably - what exactly do you want to do?), execute a program
( std::system("path/to/javac.compiler") or std::exec* functions ),
and IIRC the Java file that is produced can be run again using
a similar std::system command.

I'm not sure what you mean with the "result objects". The closest
thing to a result object in C++ is the single int returned from
int main( ). But I could imagine the Java program producing an
output file. You could read that back in C++. In fact, since Java
sources are just text, and C++ can manipulate text, you could also
modify the Java source text before you compile it, such that the
output objects are stored to a file.

HTH,
Michiel Salters

 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      01-31-2005
"msalters" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> There are some things that you can actually do in C++ (fetch a file,
> probably - what exactly do you want to do?), execute a program
> ( std::system("path/to/javac.compiler") or
> std::exec* functions ),


There are no functions in the C++ standard library
whose names begin with 'exec'.

-Mike


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot Requirements: 1.Sr Java Developer,2.Java Developer (Java with EJB) Isaac Java 0 01-20-2011 08:41 PM
hey i am just started java,, can anyone tell me the use ,application, why java , importance of java.. manish sahu Java 3 02-14-2008 12:00 AM
[JAVA] [EVALUATION] - The Java Failure (Sorry: The Java(tm) Failure) Ilias Lazaridis Java 0 02-01-2005 10:32 AM
JAVA VIRTUAL MUCHINE OR SUN JAVA Fernando Kohan Firefox 1 11-14-2004 02:04 AM
Job to convert Java App 1.3.1 to Java Newest of Java Michael Kintner Java 0 11-30-2003 04:42 AM



Advertisments