Good morning
I have a jar file which I want carried out since an interface java
created with Jdeveloper. Which is the instruction to be used and which
is the step to be followed?
I used :
Runtime r = Runtime.getRuntime();
Process p = r.getRuntime().exec("java -jar
C:\\Jdeveloper\\bin\\name.jar");
But the window of the file launches out and is established after a few
seconds.
Thank you
Simon - 19 May 2006 12:10 GMT
mo_sql schrieb:
> Good morning
>
[quoted text clipped - 9 lines]
> But the window of the file launches out and is established after a few
> seconds.
What do you mean by window? A command shell (or whatever that is called on
Windows) or a Java Frame or JFrame?
Maybe try to access the Process' input/error streams and exit code to figure out
more about a potential error?
Does "java -jar C:\Jdevelopwer\bin\name.jar" work at the command prompt?
If you do not want to fork a new java process, you can also consider to load the
class in your JAR using a ClassLoader, finding the main class and calling main()
on it, possibly using reflection. Or simply add the jar to the classpath and
just call main() if you know the class name at compile time.
Cheers,
Simon
Chris Smith - 19 May 2006 16:47 GMT
> I have a jar file which I want carried out since an interface java
> created with Jdeveloper. Which is the instruction to be used and which
[quoted text clipped - 7 lines]
> But the window of the file launches out and is established after a few
> seconds.
You losy me with that last sentence. If the code above isn't working,
what happens when your run the command:
java -jar C:\JDeveloper\bin\name.jar
from a command prompt? Does the application launch then?

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
steve - 19 May 2006 22:03 GMT
> Good morning
>
[quoted text clipped - 11 lines]
>
> Thank you
why do you need jdeveloper (an IDE) to run your jar?
there are 2 options:
1.start jdeveloper then go to the load menu, then to the run menu.
2. java -jar name.jar
steve