| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Instead of exec()'ing javac, why not call sun.tools.javac.Main? Call the main() static method, passing in String[] array with the same arguments you'd pass in from the command line. It might not only solve your problem, but it'll probably be a bit faster, as well.
If that doesn't fix the problem, or you have another reason to stick with the exec() method, I suggest you getInputStream() (which is actually the Process's stdout stream) and getErrorStream(), read from them (you'll need a separate thread for each), and output their contents to the console to debug what's going wrong.
If I can track down the source code to a little app I wrote about two years ago, I'll share it with you. It demonstrates both calling sun.tools.javac.Main and reading from the Process stdout and stderr (since it ends up running the code that it compiles).
One last suggestion regarding Virtual PC: I've had my image become corrupt several times, usually after Virtual PC reports and error and quits. Fortunately, this has not happened to me recently (perhaps the latest update from Connectix solved this), so I don't remember the exact proceed I went through. But as far as I can remember, I'd re-run the VPC installer, then re-run the updater, and I'd be able to access my existing disk image again, without having to re-install Windows or any of my other Windows software. I think one time, that was not sufficient, and I ended up uninstalling VPC, but even then, my disk image survived.
--
I hope some of this helps!
On Tuesday, Nov 26, 2002, at 11:17AM, Bill Tschumy <email@hidden> wrote:
I use Virtual-PC with Win2000 for testing my Java apps on Windows.
Recently my Virtual-PC image became corrupt and I decided to reinstall
it. After the reinstall my app that used to run fine now fails when
using exec() to invoke the javac compiler (the app is a simple
development environment). I've spent a day trying to track this down
and have now turn to this list in hopes that someone has an idea what
might be wrong. The app does still work correctly on a true Windows
machine.
In the stripped down version that fails, I basically exec() "javac"
with no args, get the process and do a process.waitFor(). This hangs
forever with the processor spinning. Invoking javac from the command
line works fine. I have tried substituting other Windows executables
for "javac" with the same result.
Anyone ever run into something similar? I think I've gotten my system
set up as before, but there must be something I have different.
--
Bill Tschumy
Otherwise -- Austin, TX
email@hidden
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.
| References: | |
| >Re: Virtual-PC & Java problem (From: Jim Cushing <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.