DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Runtime (http://www.daniweb.com/forums/thread41570.html)

freesoft_2000 Mar 21st, 2006 2:10 pm
Runtime
 
Hi everyone,

I find something very odd.
When i use the runtime class to run javac in 1.4.2 the console window does
open but when i do the same in 1.5 the console window appears.

Why is this so. Am i missing something?

Yours Sincerely

Richard West

freesoft_2000 Mar 23rd, 2006 10:15 am
Re: Runtime
 
Hi everyone,

No one has experienced this before??

Richard West

jwenting Mar 25th, 2006 9:43 am
Re: Runtime
 
uh, you're saying it appears in both 1.4 and 5.0...

That may not be what you intended to say though ;)

I hardly if ever use the runtime class, never really needed it.
And you don't either. If you dive into the Java API you'll find out how to run the compiler in-process.

freesoft_2000 Mar 25th, 2006 4:08 pm
Re: Runtime
 
Hi everyone,

Quote:

Originally Posted by jwenting
uh, you're saying it appears in both 1.4 and 5.0...

That may not be what you intended to say though ;).

Oh you are right. What i meant to say was that the console did not appear in 1.4 but appeared in 1.5 when i use the runtime class to run javac.exe

Have you ever experienced this before?

Quote:

Originally Posted by jwenting
If you dive into the Java API you'll find out how to run the compiler in-process.

Are you talking about the javac class. I am scared to use that class because its in the com.sun package and i find it risky to use as that package is not a standard part of java and may not exist in the future.

Hoping to hear from you

Yours Sincerely

Richard West

AstroNox Mar 26th, 2006 10:56 am
Re: Runtime
 
Dear Richard, that's an interesting problem I've never encountered. Please give me some time to check it out. In the meantime, could you please state your system specs (Windows or Linux), your PATH environmental variable, JDK release version (jdk1.5.0_x), and perhaps a code snippet of where the problem originated from.

freesoft_2000 Mar 26th, 2006 11:33 am
Re: Runtime
 
Hi everyone,

Quote:

Originally Posted by AstroNox
In the meantime, could you please state your system specs (Windows or Linux)

Windows

Quote:

Originally Posted by AstroNox
JDK release version (jdk1.5.0_x)

jdk1.5.0_6

Quote:

Originally Posted by AstroNox
and perhaps a code snippet of where the problem originated from.

There's no code simply using the runtime class to run javac.exe to compile a java class and the class compiles with no problem as usual but the only problem is that the console window appears during compilation but this doe not happen in 1.4.2.

Hoping to hear from you

Yours Sincerely

Richard West

AstroNox Mar 26th, 2006 11:49 am
Re: Runtime
 
Dear Richard,

I actually wanted to see the command string you passed into Runtime.getRuntime().exec(), not the code in the sense of just Runtime.getRuntime().exec(). We all know that this Java statement will generate no problems for the compiler.

freesoft_2000 Mar 26th, 2006 11:54 am
Re: Runtime
 
Quote:

Originally Posted by AstroNox
Dear Richard,

I actually wanted to see the command string you passed into Runtime.getRuntime().exec(), not the code in the sense of just Runtime.getRuntime().exec(). We all know that this Java statement will generate no problems for the compiler.

This is the command javac heri.java

Its not unusual

Richard West

AstroNox Mar 26th, 2006 3:36 pm
Re: Runtime
 
Dear Richard,

I have done some testing and I did not encounter the problem you did. I tested several DOS programs like ping and java and of course javac, using java and even javaw to test out my classes. No consoles or additional windows appeared and things functioned as expected. I'm sorry but I do not know why you encounter this problem.

jwenting Mar 27th, 2006 3:20 pm
Re: Runtime
 
yes, it is risky to use the com.sun classes.
But in theory the commandline for the compiler could also change.
And of course the compiler will have a different commandline on other operating systems.


All times are GMT -4. The time now is 5:45 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC