Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Running jar versus within eclipse  RSS feed

 
Adam Teg
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run my GUI application within eclipse, everything works fine. That is when I click on a button a text shows up in a text field I designated.

When I run the jar file, double clicking the jar file brings up the GUI but it does not respond to the buttons.

Why is this?

Thanks
 
Ted Smyth
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post your code?

Also: is it a Swing app or SWT?
 
Rob Spoor
Sheriff
Posts: 21087
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you run your JAR from the command line?
java -jar <JAR file>

Then look at what gets printed if you press the buttons. I'd say you'll get a NoClassDefFoundError, because you are most likely missing some libraries on your class path.
 
Adam Teg
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have the code infront of me. I will post it later.

I will try to run it on a cmd line.

Thanks
 
Campbell Ritchie
Marshal
Posts: 55672
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember Eclipse is an IDE and the D stands for development; you are supposed to make your code independent of it when you deploy it.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!