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 ?
Recommended Answers
Jump to Postmight be because you haven't got your environmental properties in your OS set right. if that's the case, you can click all you want. as long as the os doesn't know where your jre and libs are, it'll be treated as a simple archive, not an executable.
Jump to Postdepends on what OS you're using.
Jump to PostIf you have the default installation then your jar is being run by javaw.exe, not java.exe
That means there is no console window, so you don't see any IO from a program that just uses the console.
Try running the jar with java.exe in a command window.
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,319
Most Valuable Poster
Moderator
Featured Poster
im abcd
-4
Newbie Poster
JamesCherrill
4,319
Most Valuable Poster
Moderator
Featured Poster
im abcd
-4
Newbie Poster
JamesCherrill
4,319
Most Valuable Poster
Moderator
Featured Poster
stultuske
1,116
Posting Maven
Featured Poster
Starstreak
13
Light Poster
im abcd
-4
Newbie Poster
JamesCherrill
4,319
Most Valuable Poster
Moderator
Featured Poster
NormR1
563
Posting Sage
Team Colleague
im abcd
-4
Newbie Poster
JamesCherrill
4,319
Most Valuable Poster
Moderator
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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.