A
Andrew C. Chase
Hi all,
I've got a really strange problem vexing me.
I have an application packaged in a jar that launches fine when I
launch it from the command prompt with the command: java -jar
myfile.jar
However, when I double click on that same file from within explorer,
the program hangs somewhere in the constructor. The jar is in the same
directory in both cases, and is the only file in the directory in both
cases.
I've been debugging by putting JOptionPane.showMessageDialog commands
throughout the code so that I can see what is going on when I
double-click the jar. I have narrowed it down to the creation of a new
object which inherits from JToolbar. When I try to create the new
object, the program hangs. I can still see the javaw.exe in the Task
Manager, but thats it, no other response. I've tried putting
showMessageDialog calls in the constructor of the class which the
program is hanging on, but those never get called. The class which the
new object is from is has nothing special in it, in fact, the previous
object that is created is also from a class extending JToolBar, with
an almost identical structure.
When I comment out the line where the program is hanging (and the
corresponding line where the new JToolbar is added to the JFrame) the
program will load, but it looks like it is in a bad state because the
repaint does not work properly. This commented version of the code
works fine when started from the command prompt with java -jar
I've tried "open with" with multiple jre's to no avail...
Any suggestions?
Thanks,
Andrew
I've got a really strange problem vexing me.
I have an application packaged in a jar that launches fine when I
launch it from the command prompt with the command: java -jar
myfile.jar
However, when I double click on that same file from within explorer,
the program hangs somewhere in the constructor. The jar is in the same
directory in both cases, and is the only file in the directory in both
cases.
I've been debugging by putting JOptionPane.showMessageDialog commands
throughout the code so that I can see what is going on when I
double-click the jar. I have narrowed it down to the creation of a new
object which inherits from JToolbar. When I try to create the new
object, the program hangs. I can still see the javaw.exe in the Task
Manager, but thats it, no other response. I've tried putting
showMessageDialog calls in the constructor of the class which the
program is hanging on, but those never get called. The class which the
new object is from is has nothing special in it, in fact, the previous
object that is created is also from a class extending JToolBar, with
an almost identical structure.
When I comment out the line where the program is hanging (and the
corresponding line where the new JToolbar is added to the JFrame) the
program will load, but it looks like it is in a bad state because the
repaint does not work properly. This commented version of the code
works fine when started from the command prompt with java -jar
I've tried "open with" with multiple jre's to no avail...
Any suggestions?
Thanks,
Andrew