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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:07:21+00:00 2026-06-10T02:07:21+00:00

When I attend to build the Application particular Application I got Error Some thing

  • 0

When I attend to build the Application particular Application I got Error Some thing Like this. anyone Please Help me to Find the Problem in My App.

warning: [options] bootstrap class path not set in conjunction with -source 1.6
D:\Sirojan's Files\OOP\AsiaHospital\src\java\com\asiahospital\servlet\captcha\CaptchaServlet.java:9: error: package com.sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.JPEGCodec;
D:\Sirojan's Files\OOP\AsiaHospital\src\java\com\asiahospital\servlet\captcha\CaptchaServlet.java:10: error: package com.sun.image.codec.jpeg does not exist
import com.sun.image.codec.jpeg.JPEGImageEncoder;
D:\Sirojan's Files\OOP\AsiaHospital\src\java\com\asiahospital\servlet\captcha\CaptchaServlet.java:40: error: cannot find symbol
            JPEGImageEncoder jpegEncoder = JPEGCodec.createJPEGEncoder(jpegOutputStream);
  symbol:   class JPEGImageEncoder
  location: class CaptchaServlet
D:\Sirojan's Files\OOP\AsiaHospital\src\java\com\asiahospital\servlet\captcha\CaptchaServlet.java:40: error: cannot find symbol
            JPEGImageEncoder jpegEncoder = JPEGCodec.createJPEGEncoder(jpegOutputStream);
  symbol:   variable JPEGCodec
  location: class CaptchaServlet
4 errors
1 warning
D:\Sirojan's Files\OOP\AsiaHospital\nbproject\build-impl.xml:851: The following error occurred while executing this line:
D:\Sirojan's Files\OOP\AsiaHospital\nbproject\build-impl.xml:284: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 2 seconds)

This Error Saying Import JPEGImageEncode But I Have already Import in the Particular Servlet. Last Two Error Lines Following Below.

851: <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>

284:

This is My Captcha Servlet

package com.asiahospital.servlet.captcha;

import com.asiahospital.util.MyCaptchaService;
import com.octo.captcha.service.CaptchaServiceException;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class CaptchaServlet extends HttpServlet {


    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        byte[] captchaChallengeAsJpeg = null;
        // the output stream to render the captcha image as jpeg into
        ByteArrayOutputStream jpegOutputStream = new ByteArrayOutputStream();
        try {
            // get the session id that will identify the generated captcha.
            // the same id must be used to validate the response, the session id
            // is a good candidate!
            String captchaId = request.getSession().getId();
            // call the ImageCaptchaService getChallenge method
            BufferedImage challenge = MyCaptchaService.getInstance().getImageChallengeForID(captchaId,
                    request.getLocale());

            // a jpeg encoder
            JPEGImageEncoder jpegEncoder = JPEGCodec.createJPEGEncoder(jpegOutputStream);
            jpegEncoder.encode(challenge);
        } catch (IllegalArgumentException e) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        } catch (CaptchaServiceException e) {
            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
            return;
        }

        captchaChallengeAsJpeg = jpegOutputStream.toByteArray();

        // flush it in the response
        response.setHeader("Cache-Control", "no-store");
        response.setHeader("Pragma", "no-cache");
        response.setDateHeader("Expires", 0);
        response.setContentType("image/jpeg");
        ServletOutputStream os = response.getOutputStream();
        os.write(captchaChallengeAsJpeg);
        os.flush();
        os.close();





    }


}
  • 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-10T02:07:23+00:00Added an answer on June 10, 2026 at 2:07 am

    com.sun.image.codec.jpeg.JPEGCodec is a Sun proprietary API, you should not use it.
    I think you should read this thread and reimplement using image I/O.

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

Sidebar

Related Questions

i have this code where you can select the date you like to attend
I currently have a model Attend that will have a status column, and this
I have a table with data that looks like this: create table demo_patient_info (
I've searched a lot and the common cause of this problem is attr_ascessible :model_attributes
This is my query count = Attend.objects.filter(date = NULL).count() This gives me an enter
I have a query like this: string command = @SELECT COUNT(*) as cnt, (
I have three select statements that provide the number of Members that attend particular
I didn't attend PDC 2008, but I heard some news that C# 4.0 is
I am planning to attend a one week course on this subject. I am
This is a problem I've had on my mind for a long time. Being

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.