3

I have created one java application which takes number of external jar files and also VM arguments passed to it.

I want to create .sh file for that application so that I cat run it on any linux system.

Please suggest me any tool to create .sh file in linux and which will also takes care about the arguments which has to be pass to application to run it.

I have use the tool named JarSplice but its not working as there is problem in loading libraries after creation of sh file .

So please suggest any tool for that.

rachana
  • 3,344
  • 7
  • 30
  • 49

2 Answers2

1

If you're using maven to build your application there is a plugin called appassembler-maven-plugin that can create a .sh file for your application.

The groupId is org.codehaus.mojo.

Uwe Plonus
  • 9,803
  • 4
  • 41
  • 48
  • Thnks for your suggesion.But I have created the application using eclipse in ubuntu.So what can I do now to create .sh file. – rachana Jun 27 '13 at 11:03
1

You need to generate an executable jar, then you can simply run "java -jar main.jar" from there.

There are many questions on stackoverflow on how to create executable jars (you need ot set stuff in the MANIFEST.MF file in the jar file), for instance:

How do I create executable Java program?

Community
  • 1
  • 1
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347