Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

StreamEncoder.Class not found in rt.jar??

807605Jul 17 2007
Hi, i am using esclipse and my IDE, i got a little problem over here, whenever i call ClassName.getFile(fileName) however for some reason i got an error..

The source attachment does not contain the source for the file StreamEncoder.Class in rt,jar
    public static String getFile(String fileName) throws IOException{
        String newline = "\n";
        BufferedReader inputStream = null; //Declare a Buffered Reader to read the content of the files
        String line; //Declare a string variable to read everyline of a file
        String content = ""; //Declare content that is to be output into the text area
        try {
            inputStream = new BufferedReader(new FileReader(fileName));
            while ( (line = inputStream.readLine()) != null) {//if the line is not an emp   ty line
                if (line.trim().length() > 0){
                    content += line + newline;
                }
            }
        } finally {
            if (inputStream != null) {
                inputStream.close();
            }
        }
        return content;
    }
i use JDK 1.5.0_11.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 14 2007
Added on Jul 17 2007
0 comments
129 views