need help getting file name from command line arguments

The task I have to do is to read in a file name from the command prompt, do a histogram equalization on it and then save it as a new file with '-equalized' in the name, eg. if the original file was 'original.jpg' the new file would be 'original-equalized.jpg'.
I can't seem to get it to find the file I've created. No matter what I type it just prints "file not found" to the screen. It doesn't actually have any of the equalization stuff in it yet, I just wanted to make sure I could save the file first. If I type the name of my image "fun.jpeg" directly into the code it works, but when I type that into the command prompt it won't run.
Any suggestions as to what I'm doing wrong?

Re: need help getting file name from command line arguments

I can't seem to get it to find the file I've created.

So you should remove extraneous code and concentrate on finding the file based on the command line argument.

You can use System.out.println() to print the File instance you are using, instead of (or as well as) sending it to ImageIO.read(). There is a getAbsolutePath() method of the File class that will help here. Does the specify the File specify the file you intended?

Another thing that ought to be tested (by printing it to System.out) is the value of inputFileName. Is this the value you intend? Console programs parse and interpret the command line before your program sees it.