androidGenX
androidGenX

Reputation: 1148

Java application packaging without IDEs

I have a java application which runs in CMD and I am running it in our traditional way like :

javac test.java
java test

I have added some libraries also in my root as a folder, those are inside a folder named 'org', all dependencies are inside that. I need to package this application and make it work on client machine. How can I do that? I do not use any IDEs.

Upvotes: 4

Views: 114

Answers (4)

Krishna Aryal
Krishna Aryal

Reputation: 9

  1. Create Application Structure as follows

    MyFiles - ABC.class (File) - images (Folder) - musics (Folder)

  2. get inside of Myfiles from MS DOS

    jar cvf MyFiles.jar ABC.class images musics //jar cvf TicTacToe.jar *

Upvotes: 0

René Link
René Link

Reputation: 51323

There are many options that you have, e.g.

There is also a comparision of the most used tools available on rebellabs. Maybe this helps to make a decision.

comparision sheet from rebellabs

Image from Zeroturnaround.com (Rebellabs)

Upvotes: 1

Carsten
Carsten

Reputation: 806

  1. Compile your java classes and add them to a jar to handle them easier. As an alternative you can also include your bin directory with your compiled classed if you like.
  2. Put your libraries in a folder (so your org folder)
  3. Create a bat (Windows) or shell script (Unix) that bundles all together to a CLASSPATH and calls your main class. One example for such a batch script can be found here (old project from me): http://sourceforge.net/p/emailarchiving/code/HEAD/tree/trunk/SMTPProxy/build/run.bat That project also contains a manifest and a sample unix script. It is a standalone Java application.

This a manual process without any kind of maven or ant support. However those tools will make your life easier in the long run.

Upvotes: 2

Jigar Joshi
Jigar Joshi

Reputation: 240860

generally there is always a build manager associated with a project, for example maven or ant which abstracts out the complexity of managing dependency and packaging

I would mavenize project

Upvotes: 3

Related Questions