Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes works on WinXP jdk 1.6 but not Linux jdk 1.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "works on WinXP jdk 1.6 but not Linux jdk 1.5" Watch "works on WinXP jdk 1.6 but not Linux jdk 1.5" New topic
Author

works on WinXP jdk 1.6 but not Linux jdk 1.5

Niklas Rosencrantz
Ranch Hand

Joined: Apr 08, 2006
Posts: 49
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

Joined: Mar 06, 2001
Posts: 13459


If it is a headless Linux server...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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:



The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38016
    
  22
UnreachableCodeReachedException?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
How about ThisWillNeverHappenIPromiseException?


"I'm not back." - Bill Harding, Twister
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

throw new RuntimeException("Help me");
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38016
    
  22
At the risk of being transferred to Meaningless Drivel, throw new TheChequesInThePostException();
Niklas Rosencrantz
Ranch Hand

Joined: Apr 08, 2006
Posts: 49
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: works on WinXP jdk 1.6 but not Linux jdk 1.5
 
Similar Threads
Need help ImageToCode
Image to BufferedImage converter
lagging on loading image
Displaying images and thumbnails directly from database
How to transfer a bufferedImage Object?