• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jar File Working Improperly  RSS feed

 
Josiah Savoie
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a program that will import Access Control Lists and interpret them. When I run the program through Eclipse, the program functions properly.
However, when compiled into an executable jar, it will not run correctly.

More specifically, the issue is a JTextField. When I type a command into it and press enter, it is supposed to interpret the command and refresh the screen.
The executable jar does neither of those things. I have to note that my program works properly in Windows 8 but not Windows 7.

I'm developing in Eclipse Luna. I originally started development on a Win7 computer, then worked on a Win8 computer, now again Win7. Is it perhaps the
fact that I switched between operating systems with the file?

I did attempt compiling the same code on both operating systems but still won't work on Win7.

Let me know if you need any other information. Help would be greatly appreciated.
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure running on Win7 and Win8 will not have a difference if the source is the same. Are the 2 computers have different java version (eg one v6 and the other v7)?

You mentioned running through Eclipse works, yet outside with a jar doesn't. How are you making the jar file? ... I think you will say ... in Eclipse.

Check the content of the jar using the "jar" command (eg jar -tvf file.jar) to see if the class files are in the correct package/folder. Check the manifest file if there are dependency libraries and if the main class is set.

As for the behavior of the JTextField ... that's another thread / problem. But see if the correct build jar can run on different computers.
 
Josiah Savoie
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe it is in fact the java version. I am developing in Java 8 while the computers themselves are running Java 7. I'll let you know if it's fixed.
 
Josiah Savoie
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was it!!! I was sulking over that for a good hour or two.
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then compile and build your classes with Java 7. If this fails, meaning you have used Java 8 new features. Then not need to test on computers with Java 7 or less.

Ideally to build for old versions (v5) or popular version (v6) unless it's absolutely necessary to use latest version.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!