I have just started learning java and made an first mathematical interactive program which I wanted to distribute with my friends . But I am unable to run the .jar file .
I do the following , I click on export - Runnable.jar - Main.class and select the other options and save it . But when I run it , nothing happens :( .
I have tried looking around and I found some answers but they weren't helpful .
So how should I make an executable.jar with eclipse or without eclipse ?
im abcd
-4
Newbie Poster
Recommended Answers
Jump to Posthow do I make it run directly by double clicking ?
There needs to be an entry in the Windows Registry that specifies the command line to use when a .jar file is "opened" with a double click. Normally installation of the JRE sets the value.
There don't …
Jump to PostIt doesn't come upo because it only uses the console and when you use javaw to run the jar java does not open a console window, so you can#t see your program.
Basically, console apps and double click jars don't mix.
Jump to PostIf your program is a console program, use java vs javaw to execute it.
Add a Scanner class object and at the end of the program call a method that will block until the user enters some data.
Jump to PostThere are two versions of the program you use to execute your java classes, java.exe and javaw.exe
The only difference between them is that java.exe opens a console window where you can see your console output and enter data. Because most java programs do not use the console, there is …
Jump to PostCertainly the obvious advice is to update your program to use a GUI. This is 2012, and console-based end-user applications just aren't written any more (except in the early stages of learning Java).
You could distribute it with a tiny batch file that just has the single line
java -jar …
All 45 Replies
stultuske
1,116
Posting Maven
Featured Poster
im abcd
-4
Newbie Poster
stultuske
1,116
Posting Maven
Featured Poster
im abcd
-4
Newbie Poster
stultuske
1,116
Posting Maven
Featured Poster
im abcd
-4
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
im abcd
-4
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
im abcd
-4
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
stultuske
1,116
Posting Maven
Featured Poster
Starstreak
13
Light Poster
im abcd
-4
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
NormR1
563
Posting Sage
Team Colleague
im abcd
-4
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
im abcd
-4
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
im abcd
-4
Newbie Poster
stultuske
1,116
Posting Maven
Featured Poster
im abcd
-4
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
im abcd
-4
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
im abcd
-4
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
im abcd
-4
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.