Java Command Line Jar File

command-line, jar, java

Solution

There is no such thing as a "GUI jar" or a "command line jar". If you want a program to work on the command line, then you read and write the from System.in and System.out or files rather than using Swing or AWT.

If on the other hand you are asking how to create a jar on the command line, the command is, not too surprisingly "jar". As in `jar cf foo.jar com/my/foo/*.class`

Problem

I've created a few .jar files (using Eclipse's export feature), but they were all GUIs. I want to create a .jar file that is strictly command-line; is this possible?

Original source