Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double click .jar file to launch it in command line

I'm trying to make one of my command line utilities a little more user friendly. Most of my co-workers don't mind using the utility as a CLI, but navigating to it is a bit of a pain (to them). I'd rather not go to every computer and set up a shortcut in their CLI so:

Is there a way to make a .jar file launch a command line utility into a command prompt (preferably PowerShell?) I tried searching Google and Stack Overflow but am having a hard time making headway... Any direction would be much appreciated.

I somehow imagine this using Desktop, but am not sure how that would work.

like image 706
Jay Carr Avatar asked Sep 15 '25 01:09

Jay Carr


1 Answers

Maybe you need to make a swing based console to redirect output and input. Here are the links I found in a simple web search. (I've never used these before)

  • Message Console
  • Simple Java Console

And an open source project here at Swing-Console.

EDIT:

Another option. What if you distribute your application with a run-me.bat file?

@echo off
java -jar my-console-app.jar

You can also change the title.

like image 68
Sri Harsha Chilakapati Avatar answered Sep 17 '25 13:09

Sri Harsha Chilakapati