Exported eclipse runnable .jar will not run

codenameveg

So i'm pretty new to programming and java and I finished a Prime number program. It runs in the cmd and doesn't use any GUI. When I try to double click it the cmd window pops up for like a frame then disappears. When I try to run it with the command "java -jar _____.jar" it works fine and it works fine in eclipse. Earlier I was getting an error saying that I don't have a main manifest attribute but it seemed to go away. If you guys know the fix to the main attribute thing I could try that. Other than that anyone have any ideas?

jtwaller

Here's a link to a previous similar question. They have some good solutions there.

A simple one to try starting out is JarFix which will re-associate .jar files with the right java exe.

If your program is immediately closing upon running, try adding snippet at the end of it to keep the process alive.

System.out.println("Press enter to close.");
try {
    System.in.read();
} catch (Exception e) {
    e.printStackTrace();
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to execute a runnable jar file in eclipse

From Dev

Runnable jar runs too slow compared to eclipse project

From Dev

Eclipse exported Runnable JAR not showing images

From Dev

Java project working on Eclipse but not working when exported to runnable jar file

From Dev

How to make the runnable jar file for a maven eclipse project with hibernate configuration

From Dev

Eclipse's "Export Runnable JAR" and Maven's "package" command

From Dev

Image not displaying in JAR file, but display on Eclipse run

From Dev

UnsatisfiedLinkError in exported (Eclipse) executable jar file

From Dev

JavaFX Project breaks when exported to runnable .jar? FXMLLoader related?

From Dev

How do I create a runnable JAR in IntelliJ as I would in Eclipse

From Dev

Eclipse Java9 Export Runnable JAR file

From Dev

Deploying a runnable jar in ECLIPSE by considering dependencies

From Dev

Eclipse: Create Runnable .jar WITH manifest possible?

From Dev

how to make runnable jar for javaCV or openCV project from Eclipse

From Dev

Exporting Runnable JAR in eclipse with User Libraries included

From Dev

Java - program works perfectly in eclipse but does not seem to do its intended task when exported to runnable jar

From Dev

Java project runs properly in command line (exported jar), but not using Eclipse

From Dev

DynamicReports won't work when exported to a runnable jar

From Dev

Java eclipse error with exported runnable jar file

From Dev

Have installed Babel for german language. Application run in Eclipse is now german, but exported as "Eclipse product" is still english

From Dev

Instanceof works if project is run from eclipse, but not when its exported

From Dev

Eclipse export to runnable .jar

From Dev

Not able run Spring boot application as runnable jar from command prompt

From Dev

Run a testNG test suite with a jar / no runnable method

From Dev

OpenCV Exporting Runnable JAR in Eclipse

From Dev

InvalidInputException when running a jar exported from Eclipse

From Dev

Eclipse not finding main method when trying to export to runnable JAR

From Dev

Eclipse exported Runnable Jar fails througing java.lang.UnsatisfiedLinkError exception

From Dev

Different behavior in JAR file vs Runnable JAR file exported from Eclipse

Related Related

  1. 1

    how to execute a runnable jar file in eclipse

  2. 2

    Runnable jar runs too slow compared to eclipse project

  3. 3

    Eclipse exported Runnable JAR not showing images

  4. 4

    Java project working on Eclipse but not working when exported to runnable jar file

  5. 5

    How to make the runnable jar file for a maven eclipse project with hibernate configuration

  6. 6

    Eclipse's "Export Runnable JAR" and Maven's "package" command

  7. 7

    Image not displaying in JAR file, but display on Eclipse run

  8. 8

    UnsatisfiedLinkError in exported (Eclipse) executable jar file

  9. 9

    JavaFX Project breaks when exported to runnable .jar? FXMLLoader related?

  10. 10

    How do I create a runnable JAR in IntelliJ as I would in Eclipse

  11. 11

    Eclipse Java9 Export Runnable JAR file

  12. 12

    Deploying a runnable jar in ECLIPSE by considering dependencies

  13. 13

    Eclipse: Create Runnable .jar WITH manifest possible?

  14. 14

    how to make runnable jar for javaCV or openCV project from Eclipse

  15. 15

    Exporting Runnable JAR in eclipse with User Libraries included

  16. 16

    Java - program works perfectly in eclipse but does not seem to do its intended task when exported to runnable jar

  17. 17

    Java project runs properly in command line (exported jar), but not using Eclipse

  18. 18

    DynamicReports won't work when exported to a runnable jar

  19. 19

    Java eclipse error with exported runnable jar file

  20. 20

    Have installed Babel for german language. Application run in Eclipse is now german, but exported as "Eclipse product" is still english

  21. 21

    Instanceof works if project is run from eclipse, but not when its exported

  22. 22

    Eclipse export to runnable .jar

  23. 23

    Not able run Spring boot application as runnable jar from command prompt

  24. 24

    Run a testNG test suite with a jar / no runnable method

  25. 25

    OpenCV Exporting Runnable JAR in Eclipse

  26. 26

    InvalidInputException when running a jar exported from Eclipse

  27. 27

    Eclipse not finding main method when trying to export to runnable JAR

  28. 28

    Eclipse exported Runnable Jar fails througing java.lang.UnsatisfiedLinkError exception

  29. 29

    Different behavior in JAR file vs Runnable JAR file exported from Eclipse

HotTag

Archive