944,027 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 3037
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Mar 21st, 2006
0

Runtime

Expand Post »
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
Similar Threads
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Mar 23rd, 2006
0

Re: Runtime

Hi everyone,

No one has experienced this before??

Richard West
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Mar 25th, 2006
0

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Mar 25th, 2006
0

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
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Mar 26th, 2006
0

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.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
AstroNox is offline Offline
50 posts
since Mar 2006
Mar 26th, 2006
0

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
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Mar 26th, 2006
0

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.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
AstroNox is offline Offline
50 posts
since Mar 2006
Mar 26th, 2006
0

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
Reputation Points: 25
Solved Threads: 10
Practically a Master Poster
freesoft_2000 is offline Offline
623 posts
since Jun 2004
Mar 26th, 2006
0

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.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
AstroNox is offline Offline
50 posts
since Mar 2006
Mar 27th, 2006
0

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Last Edited
Next Thread in Java Forum Timeline: ResultSet.... getterMethod()





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC