0

I made a simple standard-lone java Application using Spring,Apache Camel,Activemq for processing messages.

Note: My Application don't have any GUI.

My project structure is in the following way.

enter image description here

SACLib folder have nearly 70 external jars(all Spring,Camel and Activemq corresponding jars).

It's working fine in Eclipse. SO Now We want to deploy into Jar file.I tried in Eclipse,But I didn't seen Rod1,Rod2,Copy1 and SACLib folders in my Jarfile.

after Deploying Jar, If I run FirstConsumer.java it runs Rod1-->ThMapInfratab1-2.exe file. For this I mention Real paths of .exe file.

How can I make Jar file with including all my folders.

Thanks

Community
  • 1
  • 1
Hanumath
  • 1,117
  • 9
  • 23
  • 41

2 Answers2

3

Well, this is a kind of work that is typically done with build automation tools like Apache Ant, Maven or Gradle, so you can investigate there if you want to make this happen automatically next time.

But, if you want to do it manually...

First, you project needs a META-INF folder where you will place a file called a MANIFEST.

That manifest contains a Main-Class entry pointing to you main class. You can read about this in the Java Tutorial: Setting Application's Entry Point.

But it can also contain a Class-Path entry, pointing to all other jars required by your application and that should be loaded by the executable jar.

You can read about it the Java Tutorial: Adding Classes to your Jar Class Path.

If you are building your executable jar with Eclipse, it will let you choose the MANIFEST file that you want to use during the creation process.

Now, if you want to use build automation tools, there are other answers here that explain how to do it:

Community
  • 1
  • 1
Edwin Dalorzo
  • 76,803
  • 25
  • 144
  • 205
2

simply using ant download it , and then make a build.xml file and put it

Here's an simple example of an ant target that will create a jar (named test.jar) that includes all jar files under the lib directory. Maybe this will solve your problem?

for using apache ant, see this

http://ant.apache.org/manual/using.html

jdev
  • 5,304
  • 1
  • 17
  • 20