It's not a secret anymore!*
The moose likes Beginning Java and the fly likes how to call .jar file by clicking the JButton..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to call .jar file by clicking the JButton..?" Watch "how to call .jar file by clicking the JButton..?" New topic
Author

how to call .jar file by clicking the JButton..?

Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
hi, can u help me out by giving the answer that how to call .jar file by clicking the JButton....?


Regards,
Jignesh

The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Why not just call the method in the class in the jar that you want to execute directly rather than using the Runtime.getRuntime().exec() method?
[ February 03, 2005: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Raj Maheshwari
Ranch Hand

Joined: Jul 02, 2004
Posts: 34
Jignesh

You might want to find out what class/method you wish to access in the jar file and call that method. just make sure that the jar file is in your classpath so your program has access to it.

hth
Raj
 
Don't get me started about those stupid light bulbs.
 
subject: how to call .jar file by clicking the JButton..?
 
Similar Threads
call java code from javascript
Error connecting to database from executable JAR file.
how to call .exe file by clicking the JButton..?
JButton and JSP
From Web interface to Swing