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 7670885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:55:27+00:00 2026-05-31T15:55:27+00:00

public BufferedImage readImage(String fileLocation) { BufferedImage img = null; File file = new File(D:\\logo.jpg);

  • 0
 public BufferedImage readImage(String fileLocation) {
        BufferedImage img = null;

        File file = new File("D:\\logo.jpg");
            img = ImageIO.read(file);
}

throwing error can;t read the file

  • 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-05-31T15:55:28+00:00Added an answer on May 31, 2026 at 3:55 pm

    The code should be like as follows,

    BufferedImage img = null;
    try {
         img = ImageIO.read(new File("D:\\logo.jpg"));
    } catch (IOException e) {
          System.out.println("Exception is --- "+ e.getMessage());
          e.printStackTrace();
    }
    

    Then you can trace actual cause of the problem as we are printing message and stack trace if exception occurs.

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

Sidebar

Related Questions

I have a buffered image with the sizes of my frame: public BufferedImage img;
public class Test { public static void main(String[] args) { DemoAbstractClass abstractClass = new
public void saveImage(String path){ BufferedImage image = (BufferedImage) createImage(500, 500); Graphics gImage = image.getGraphics();
Basically I would like to turn off antialias in the following: public BufferedImage createText(String
I am having some problem in writing bufferedimage to jpg file. in my method
I have this service with RESTeasy: @GET @Path(/{name}) @Produces(image/jpeg) public BufferedImage get(@PathParam(name) String name)
public final BufferedImage filter(BufferedImage src, BufferedImage dst) Transforms the source BufferedImage and stores the
package test; import java.awt.*; import java.awt.event.*; import java.awt.geom.Ellipse2D; import java.awt.image.BufferedImage; import javax.swing.*; public class
public static class TestTask extends AsyncTask<Void, Integer, Integer> { private String stacktrace; public TestTask
public static void main(String[] args) { int i = 0; while(i==0){ System.out.println(Possibilities: R, T,

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.