954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Running a CLI based program

I've never actually ran a CLI based program outside of bluej.
And after exporting one of my programs to a jar, I noticed I was not able to get any results when double clicking the jar.
So, I'm guessing CLI based programs are run by a different method, or require some extra code?
Any help is appreciatied.

kimbokasteniv
Junior Poster in Training
50 posts since Nov 2006
Reputation Points: 13
Solved Threads: 4
 
I've never actually ran a CLI based program outside of bluej. And after exporting one of my programs to a jar, I noticed I was not able to get any results when double clicking the jar. So, I'm guessing CLI based programs are run by a different method, or require some extra code? Any help is appreciatied.

You can convert the Jar to an Exe, and run it then. Just google "Jar to Exe."
At least that's how I how I did it, perhaps there's an easier way.

Colin Mac
Posting Whiz
327 posts since Sep 2006
Reputation Points: 78
Solved Threads: 22
 

Thanks, I was not aware of that.
In the end what I ended up doing was compiling it through the command prompt. Then I changed the current directory I was viewing to that of the java file. Then using the java command and the classes name to run the program.
However it seems like I can only start the program from the command prompt, unless I write a batch file to do it.
So I'll look into what you suggested.

kimbokasteniv
Junior Poster in Training
50 posts since Nov 2006
Reputation Points: 13
Solved Threads: 4
 
Thanks, I was not aware of that. In the end what I ended up doing was compiling it through the command prompt. Then I changed the current directory I was viewing to that of the java file. Then using the java command and the classes name to run the program. However it seems like I can only start the program from the command prompt, unless I write a batch file to do it. So I'll look into what you suggested.

Ok, well I used the trial of exe4J to do it. If you download it, skip option 1 and go to the second option and select Jar To Exe. You'll see what I mean if you install it.

Colin Mac
Posting Whiz
327 posts since Sep 2006
Reputation Points: 78
Solved Threads: 22
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You