wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Runtime" Watch "Runtime" New topic
Author

Runtime

Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
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
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Originally posted by Richard West:
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


Is there a code sample you could post?

I guess something may have changed in 1.5 for this... I don't know why. Does it matter?
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
Originally posted by Maximilian Stocker:


Is there a code sample you could post?

I guess something may have changed in 1.5 for this... I don't know why. Does it matter?


There is not much code only the usual way of running javac.exe with the runtime class. The class compiles but the only difference is that the console window opens.

It matters for me because it simply looks better if the class compiles without the console window opening like in 1.4.2.

Is it something i am doing wrong?
Is there another way i can compile the class without the console window opening?

Hoping to hear from you

Yours Sincerely

Richard West
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
No one knows this?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41077
    
  43
You may be able to run the compiler directly through its Java API, instead of running an external process. Something like this:

sourceFile1 and sourceFile 2 are File objects; you can add as many as you need. There's probably a way to set the classpath as well.
[ March 21, 2006: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
Hi everyone,

Originally posted by Ulf Dittmer:


I can't its in the com.sun packages.
These packages may not exist in the future thus its much too risky for me.

I am still puzzled about my original question?
Has anyone experienced this before

Richard West
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
This documentation from Sun:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html#proginterface

makes it sound like the compile methods *are* part of a public API.


There is no emoticon for what I am feeling!
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
Originally posted by Jeff Albertson:
makes it sound like the compile methods *are* part of a public API.[/QB]


This is what it says it the above link

"Note that all other classes and methods found in a package whose name starts with com.sun.tools.javac (informally known as sub-packages of com.sun.tools.javac) are strictly internal and subject to change at any time."

Its too risky for me to use a class that may not exist in the future

But going back to my original question have you noticed that when you compiled java classes using the runtime class in 1.4.2 the console does not open up but the console opens up in 1.5.

Have anyone expereience this before and is there a way around this
or am i doing something wrongly

Hoping to hear from you guys

Yours Sincerely

Richard West
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
"Note that all other classes and methods found in a package whose name starts with com.sun.tools.javac (informally known as sub-packages of com.sun.tools.javac) are strictly internal and subject to change at any time."

Don't forget to include their emphasis
[ March 23, 2006: Message edited by: Jeff Albertson ]
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
Hi everyone,

True but let's suppose if i prefer to use the runtime class
and run the javac.exe class, have you ever experiened the problem that have?

Richard West
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
Hi everyone,

No one has any idea about this topic?

Richard West
Richard West
Ranch Hand

Joined: Jan 07, 2005
Posts: 127
Anyone??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Runtime
 
Similar Threads
Help with number guessing game
Logging
java jdeveloper
Java command not working in console
No console window when running manifest file?