I have this java program that I want to package within a jar. It compiles fine and it compiles without errors into a jar. But when I double click it, it wont start. I know most jar applications uses JFrame and that works fine. But is it possible to make it command prompt/shell based? (Like Displaying System.out.println)
Example is it possible to execute this code by double clicking a jar:
public class Hello
{
public static void main( String[] args )
{
System.out.println( "Hello, World!" );
}
}
You can change the file association for jar files to have them open a console. (This is for Windows)
ftype jarfile
ftype jarfile "C:\Path\To\Java\bin\java.exe" -jar "%1" %*
(You may need administrator privileges to do this).