How to execute the jar file from a java class

Soorya Prakash

I am having the java main application which needs to execute another jar file and return it without waiting for the jar execution complete. Is it possible to achieve it using Java. Can anyone give some inputs in it.

Pramod S. Nikam

Do following:

Runtime.getRuntime().exec("java -jar <PATH_OF _JAR>");

in your Main class.

And as @Yoav has suggested. You need to take care of errors by adopting proper error handling strategy.

Do Read - https://www.tutorialspoint.com/java/lang/runtime_exec.htm

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Execute a java class file that uses class from a jar file

From Dev

How to execute a main class in a jar from gradle using the 'java' command

From Dev

How to execute a java class in jar from a shell script

From Dev

How to convert all .class files into .java file from a .jar file

From Dev

execute jar file from remote machine in java

From Dev

Execute jar file from inside a Java program

From Dev

How to execute a java class file from maven command line

From Dev

How to run a java class from a jar file dynamically

From Dev

How to add class files and folders to a jar file from a directory in Java

From Dev

How to execute a jar file within a jar file

From Dev

execute jar file in java program

From Dev

execute jar file in java program

From Dev

How can I execute a .jar file from the terminal

From Dev

How can I execute a .jar file from the terminal

From Dev

How to execute a jar file trough java on a different directory

From Dev

Execute Jar from Java code

From Dev

unable to load java class from jar file file

From Dev

How, or is it possible, to execute a java app from an unzipped jar

From Dev

How, or is it possible, to execute a java app from an unzipped jar

From Dev

How to Run a Java Class File from the Command Line that was Compiled by Eclipse? External Jar problems

From Dev

Java anti-hacking. How protect .class file from being changed in my jar

From Dev

Unable to execute java class file from php exec method?

From Dev

how to execute php file from android class using the Post method

From Dev

how to execute php file from android class using the Post method

From Dev

How to load unknown class from downloaded jar file during runtime?

From Dev

How to get annotation's parameters from a class in jar file

From Dev

How can I execute jar file in UNIX-like using this command line: java -jar mysolution.jar < inputfile.txt

From Dev

How to create a exe file from jar file for database application in Java?

From Dev

how to execute a runnable jar file in eclipse

Related Related

  1. 1

    Execute a java class file that uses class from a jar file

  2. 2

    How to execute a main class in a jar from gradle using the 'java' command

  3. 3

    How to execute a java class in jar from a shell script

  4. 4

    How to convert all .class files into .java file from a .jar file

  5. 5

    execute jar file from remote machine in java

  6. 6

    Execute jar file from inside a Java program

  7. 7

    How to execute a java class file from maven command line

  8. 8

    How to run a java class from a jar file dynamically

  9. 9

    How to add class files and folders to a jar file from a directory in Java

  10. 10

    How to execute a jar file within a jar file

  11. 11

    execute jar file in java program

  12. 12

    execute jar file in java program

  13. 13

    How can I execute a .jar file from the terminal

  14. 14

    How can I execute a .jar file from the terminal

  15. 15

    How to execute a jar file trough java on a different directory

  16. 16

    Execute Jar from Java code

  17. 17

    unable to load java class from jar file file

  18. 18

    How, or is it possible, to execute a java app from an unzipped jar

  19. 19

    How, or is it possible, to execute a java app from an unzipped jar

  20. 20

    How to Run a Java Class File from the Command Line that was Compiled by Eclipse? External Jar problems

  21. 21

    Java anti-hacking. How protect .class file from being changed in my jar

  22. 22

    Unable to execute java class file from php exec method?

  23. 23

    how to execute php file from android class using the Post method

  24. 24

    how to execute php file from android class using the Post method

  25. 25

    How to load unknown class from downloaded jar file during runtime?

  26. 26

    How to get annotation's parameters from a class in jar file

  27. 27

    How can I execute jar file in UNIX-like using this command line: java -jar mysolution.jar < inputfile.txt

  28. 28

    How to create a exe file from jar file for database application in Java?

  29. 29

    how to execute a runnable jar file in eclipse

HotTag

Archive