Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Cannot import a package

  1. #1
    Junior Member
    Join Date
    Apr 2023
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cannot import a package

    I am creating a JSP page UploadFile.jsp. I keep getting an error on an import line. The org.apache.commons.fileupload.disk cannot be resolved.

    I need this package as I need the DiskFileItemFactory class in my code.

    Based on my online research, I pasted the following JAR files to the WEB-INF/lib folder. commons-fileupload-1.0-5.5.23.jar, commons-io-2.11.0.jar, org.apache.commons.io.jar and poi-3.17.jar. I still kept getting the error. I then added these JAR files to the classpath but it did not resolve the issue.

    I would appreciate any help in resolving this issue.
    Last edited by busybee; April 23rd, 2023 at 08:20 AM.

  2. #2
    Junior Member
    Join Date
    Apr 2023
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cannot import a package

    I am trying to replicate the code on the following tutorial site.

    https://www.tutorialspoint.com/jsp/j..._uploading.htm

    However I keep getting an error with UploadFile.jsp.
    Last edited by busybee; April 23rd, 2023 at 09:05 AM.

  3. #3
    Junior Member
    Join Date
    Apr 2023
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cannot import a package

    My problem is resolved. I did not have the latest version of commons-fileupload.jar. I can import the package I need after I downloaded the correct version of the JAR file.

Similar Threads

  1. Correctlly import external package.
    By gamezzjacx in forum Java Theory & Questions
    Replies: 1
    Last Post: March 9th, 2021, 06:58 AM
  2. how to import/ access classes created in one package in another package
    By ydandurkar in forum What's Wrong With My Code?
    Replies: 8
    Last Post: May 11th, 2014, 11:12 AM
  3. [SOLVED] Which is more efficient? "import java.package.subpackage" or "import java.package.*"
    By Andrew R in forum Java Theory & Questions
    Replies: 1
    Last Post: August 18th, 2013, 01:11 PM
  4. Replies: 4
    Last Post: November 8th, 2012, 07:55 AM
  5. how to compile java and import it as package
    By clementnas in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 19th, 2011, 05:53 AM