• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

works on WinXP jdk 1.6 but not Linux jdk 1.5

 
Niklas Rosencrantz
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends, why won't this code resizing a GIF image work on Linux with JDK 1.5? It works well on WinXP with JDK 1.6. On Linux it just produces an empty thumbnail image.

[ May 03, 2008: Message edited by: Niklas Rosencrantz ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If it is a headless Linux server...
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This shows you why should never ignore any exception unless you are 100% sure it will not occur. In that case, you should document WHY it will not occur; not only for other programmers to read, but also for yourself months later.

In any case where the exception might (or will) occur, at least print its stack trace.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob Prime:
This shows you why should never ignore any exception unless you are 100% sure it will not occur. In that case, you should document WHY it will not occur; not only for other programmers to read, but also for yourself months later.


At work, we even don't ignore those exceptions. We "document" them by throwing an UnreachableCodeReachedException (which is a runtime exception), and sign it with our initials:

 
Campbell Ritchie
Sheriff
Pie
Posts: 49824
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UnreachableCodeReachedException?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about ThisWillNeverHappenIPromiseException?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
throw new RuntimeException("Help me");
 
Campbell Ritchie
Sheriff
Pie
Posts: 49824
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the risk of being transferred to Meaningless Drivel, throw new TheChequesInThePostException();
 
Niklas Rosencrantz
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
catch(AvoidingTheQuestionException){
Actually, Linux with JDk 1.5 doesn't seem to support GIF writing in the standard libraries. I must upgrade to 1.6 or use third party library.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic