aspose file tools*
The moose likes I/O and Streams and the fly likes How can I solve this error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How can I solve this error?" Watch "How can I solve this error?" New topic
Author

How can I solve this error?

Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
Hello,

I'm using JDT (Java DICOM Toolkit) "http://wiki.trispark.com/dashboard.action" for reading a DICOM file using the following code, but getting an error in the following:



How can I solve this problem?





Thanks.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

What's the error? Is it a compiler error or an exception?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
Rob Prime wrote:What's the error? Is it a compiler error or an exception?


Thanks for your reply.

Actually, it is a "Compiler error" asking me to do something like creating a local variable "fin", although I have it.

So, yes, a compiler error not an exception.

Thanks.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2861
    
  11

You declare fin inside a try block, so it's out of scope before you use it. You need to declare it outside the try, though you can set the value inside the try block as you do now. Note that fin will be null after the try-catch if there is a FileNotFoundException. You might want to do something about that as well.
Abder-Rahman Ali
Ranch Hand

Joined: May 22, 2008
Posts: 138
Greg Charles wrote:You declare fin inside a try block, so it's out of scope before you use it. You need to declare it outside the try, though you can set the value inside the try block as you do now. Note that fin will be null after the try-catch if there is a FileNotFoundException. You might want to do something about that as well.


Yes, exactly correct GReg, I didn't notice.

And, now, getting as output: Unable to find key file 'jdt.key' in classpath

I think this is due that the JARS I'm using are commercial and need a key for the evaluation version of the product.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I solve this error?