0

I made a .jar file using NetBeans. When I move it to any place on my laptop and double click it, it will work. When I try it on a different PC, it gives me a message box saying:

title: Java Virtual Machine Launcher.

text: A Java Exception has occurred.

Every PC i tried so far, gives me this. Those PCs do not have any additional Java software installed, only the basic one which updates itself automatically. If there is a way to share my Java file on different PCs, please tell me (even if this involves converting the file to some other format, but not that the user has to install anything extra).

Here is my error: enter image description here

2 Answers2

0

If in the PC where the program was created works, but in any other one fails, it seems it's a problem with some resource. Maybe you used an absolute path to find a resource file but that file is not in the jar. I think it works because the file can be found in your PC, but not in anyone else.

Pablo Lozano
  • 10,122
  • 2
  • 38
  • 59
0

How about creating a bat file and setting java home inside it. So you could first set the home or path and then use java jar commands to execute the jar.

Syam S
  • 8,421
  • 1
  • 26
  • 36