0

As my question specifies i am creating Runnable JAR file of my project using Eclipse IDE.

This JAR file runs fine on my computer but unable to run on other computers.

How to identify what's the problem?

I read lots of links but still problem is not solved.

.jar file will not open

Generated JAR file is not executing

Creating Jar file - doesn't work on other computers

and many others.

Please tell me the solution what can i do in such problem?

Community
  • 1
  • 1
Nirav Kamani
  • 3,192
  • 7
  • 39
  • 68
  • Start by looking at the actual error when you try and run it.... – Tim B Jan 21 '14 at 10:21
  • What error do you get on other computers? And does running the jar really work on your computer (i.e. double click the jar, not just run the project from your IDE)? – Njol Jan 21 '14 at 10:21
  • @Njol yes it runs by double click but on other computers it does not run. – Nirav Kamani Jan 21 '14 at 10:23
  • What happens when someone else tries to run it? – user253751 Jan 21 '14 at 10:26
  • 1
    run it from console: java -jar yourjar.jar in the "others" computer and attach the error – Brierson Jan 21 '14 at 10:31
  • 1
    It depends on what is inside the jar. Did you chose to export all the used libraries? Are you using native libraries? Please paste a stack trace. – adriannieto Jan 21 '14 at 10:40
  • 1
    Please give more information. Either other PC has no java installed, java cannot be found, program throws an error (seen from cmdline), or program swallows errors, etc. – skiwi Jan 21 '14 at 10:50
  • 3
    In addition to the other comments, if your jar was compiled using java 1.7 but the other computer's JVM is 1.6, then it won't run. – Teresa Carrigan Jan 21 '14 at 11:15

2 Answers2

1

It could be lot's of reasons. What is the error message? Try to catch an Exception with try catch block and save it to some file, then read it.

Ernestas Gruodis
  • 8,567
  • 14
  • 55
  • 117
1

Move the jar to another directory on your computer and double-click it there. It should not run there. Otherwise you have used File-s instead of resources (getClass().getResource[AsStream]()).

Do not throw away exceptions: so a command line run (cmd) with java -jar ... will show any exceptions.

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138