Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

please help me

Thread view: 
mo_sql - 19 May 2006 11:39 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.