Starting JAR from java code

K

kiel44

Hi,
i have one question.
I have two jar files. First is main program, second is a update program.
update jar run as first , check main program and download upadets. After
that he suppose to run jar with main program and close. But I don't know how
to do it. Could somebody write me how to start jar file form java code? In
internet i found only how to start exe files :(.
 
R

Roedy Green

I have two jar files. First is main program, second is a update program.
update jar run as first , check main program and download upadets. After
that he suppose to run jar with main program and close. But I don't know how
to do it. Could somebody write me how to start jar file form java code? In
internet i found only how to start exe files :(.

if you are doing an Applet, all you have to do is call a method in a
class in the other jar possibly main, so long as the jar is mentioned
in the archive tag or the jar Class-Path manifest it will find it. You
might want to use the Jar index feature to speed this up.
see http://mindprod.com/jgloss/jar.html


You don't need to fire up a whole new JVM for it most of the time. If
you do, then see http://mindprod.com/jgloss/exec.html
 
R

Roedy Green

T

Tor Iver Wilhelmsen

Roedy Green said:
but if you know the same of the class you want, and the jar is on the
classpath, there is nothing special to do. You just execute a method
of some class in the jar usually main.

But do install a SecurityManager first to avoid having that second
"main()" assume it runs standalone and call System.exit().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top