It's not a secret anymore!*
The moose likes Java in General and the fly likes Executing a program in an ear file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Executing a program in an ear file" Watch "Executing a program in an ear file" New topic
Author

Executing a program in an ear file

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I have an ear file that contains a jar which contains the entry point program. Call it myProgram.class. How can I set up a bat file to execute
myProgram?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14280
    
  21

EAR files (Enterprise ARchive) normally contain Java EE applications that you need to deploy on a Java EE application server. Do you have a JAR file inside your EAR file that contains a standalone Java application?

EAR files are really just JAR files. So you can use the JAR utility to look inside them and extract files from them.

You'll need to extract the JAR file from the EAR, and run the application using the extracted JAR file. You can't directly run an application that's inside a JAR file inside an EAR file.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
 
subject: Executing a program in an ear file