Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9017831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:22:18+00:00 2026-06-16T04:22:18+00:00

A FileNotFound Exception is being thrown for my code even though I have the

  • 0

A FileNotFound Exception is being thrown for my code even though I have the file in the exact directory I stated. I have also tried ...new File("euler8.txt");... with no success. My code is as follows:

        private static void euler8() throws IOException
{   
    int current;
    int largest=0;
    int c =0;
    ArrayList<Integer> bar = new ArrayList<Integer>(0);
    File infile = new File("C:/Users/xxxxxxxx/workspace/Euler1/euler8.txt");
    BufferedReader reader = new BufferedReader(
            new InputStreamReader(
            new FileInputStream(infile),
            Charset.forName("UTF-8")));
    try
    {
        while((c = reader.read()) != -1) 
        {
            bar.add(c);
        }
    }
    finally{reader.close();}
    for(int i=0; i<bar.size(); i++)
    {
        current = bar.get(i) * bar.get(i+1) * bar.get(i+2) * bar.get(i+3) * bar.get(i+4);
        if(largest<current)
            largest = current;
    }
}

Image of what it is doing:

http://img163.imageshack.us/img163/7017/halpbk.png

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:22:19+00:00Added an answer on June 16, 2026 at 4:22 am

    Except for everything else that has been suggested, you could check whether you’re having this issue (which we’ve been seeing in our lab): Files with twice the extension. In other words, make sure your euler8.txt is really called that and not euler8.txt.txt, for instance, because, with hidden extensions, the file explorer will show the first but it may not strike you as odd initially, if you don’t remember that it’s supposed to hide the extension.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a file not found exception for this code: (System.IO.FileNotFoundException : Die
I have a file download servlet running on Tomcat, the code is public void
i have the following piece of code my my web.config: <customErrors mode=On defaultRedirect=~/Exception.aspx enableVersionHeader=false>
I have written a code which prints 1 if the number being tested is
I need help identifying the reason why an exception is being thrown and how
I have tried multiple ways to create this zip file in Java/Groovy. The first
I have this code in a Java EE Application for reading the Properties file.
I'm running the following code: new FileSystemXmlApplicationContext(/data/farm/Server/confData/1000004/contex.xml) and it throws java.io.FileNotFoundException: class path resource
I am new to JSP and I am trying to write the below code:
I have to, quote on quote, 1.Save accounts to a binary (serialized) file. 2.Load

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.