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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:42:15+00:00 2026-06-14T12:42:15+00:00

First of all: I’ve read through all the cannot find symbol threads I could

  • 0

First of all: I’ve read through all the cannot find symbol threads I could find here. None of them solved the problem I’m facing. I’m not a professional Java Developer and I’m just helping out a colleague with this classes so please go easy on me.

Let me describe the basic situation first:

I have a package called pdfDownload located at src/pdfDownload. In this directory I’ve got 2 files: PDFItem.java and PDFItemParser.java.

Both are public classes. You can find the code of the classes attached below. I’m using Eclipse IDE shows no warnings nor errors**.

When I compile them I get the following error message:

 PDFItemParser.java:19: cannot find symbol symbol  : class PDFItem
 location: class pdfDownload.PDFItemParser  public static
 ArrayList<PDFItem> parseFile(String filePath){
            ^ PDFItemParser.java:11: cannot find symbol symbol  : class PDFItem location: class pdfDownload.PDFItemParser
    ArrayList<PDFItem> items = parseFile("data.csv");    
              ^ PDFItemParser.java:20: cannot find symbol symbol  : class PDFItem location: class pdfDownload.PDFItemParser         ArrayList<PDFItem>
 items = new ArrayList<PDFItem>();      /* Creates an ArrayList from type
 PDFItem which will contain all parsed ItemObjects */
                  ^ PDFItemParser.java:20: cannot find symbol symbol  : class PDFItem location: class pdfDownload.PDFItemParser
        ArrayList<PDFItem> items = new ArrayList<PDFItem>();        /* Creates an
 ArrayList from type PDFItem which will contain all parsed ItemObjects
 */
                  ^ PDFItemParser.java:21: cannot find symbol symbol  : class PDFItem location: class
pdfDownload.PDFItemParser       items.add(new PDFItem());
                      ^ 5 errors

The classes are both public, in the correct directory and package. I also get auto-completion in Eclipse for the PDFItem inside the PDFItemParser class. Me and my colleague have been struggling to solve this for 2 hours now. I’m sorry if it’s really easy for you guys but we couldn’t solve it because the usual cases for this error didn’t apply. Thanks in advance!

Edit: I compile them in the (Mac) Terminal. I open the path in the Terminal, and type in:

 javac PDFItem.java

and then

 javac PDFItemParser.java

PDFItem – Class Code:

    package pdfDownload;

    public class PDFItem {

        String imageURL;
        String pdfURL;
        boolean imageLoaded;
        boolean pdfLoaded;
        String name;


        public PDFItem() {

        }

        public PDFItem(String name) {
            this.name = name;
        }

    }


PDFItemParser - Class Code:
---------------------------

    package pdfDownload;

    import java.util.ArrayList;
    import java.io.*;


    public class PDFItemParser {

        public static void main(){

        ArrayList<PDFItem> items = parseFile("data.csv");    

        if(items != null){
            System.out.println(items.get(0).name);
        }
    }


        public static ArrayList<PDFItem> parseFile(String filePath){
            ArrayList<PDFItem> items = new ArrayList<PDFItem>();            /* Creates an ArrayList from type PDFItem which will contain all parsed ItemObjects */
            items.add(new PDFItem());

            try{
                FileInputStream fstream = new FileInputStream(filePath);
                DataInputStream in = new DataInputStream(fstream);              /* Get the object of DataInputStream */

                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String strLine;
                while ((strLine = br.readLine()) != null)   {           /* Read File Line By Line  */

                  System.out.println (strLine);             /* Print the content on the console */

                }
                in.close();             /* Close the input stream */

            }
            catch (Exception e){            /* Catch exception if any */
                System.err.println("Error: " + e.getMessage());
            }

            return items;               /* Returns ArrayList */
        }

    }
  • 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-14T12:42:16+00:00Added an answer on June 14, 2026 at 12:42 pm

    You should compile your classes using this command to make sure that your classes go into a folder created for your package: –

    javac -d . PDFItem.java
    javac -d . PDFItemParser.java
    

    When you compile it without a -d flag, then your classes are not inside a package folder, where they are actually searched. And hence your PDFItemParser is not able to find your PDFItem class.

    Also, make sure that the you have added the path till your package folder in your classpath. Add the path only till the folder with package name, and not till the class name.

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

Sidebar

Related Questions

First of all I've gone through dozens of posting here on SO and google
First of all. I want to say that i've acctualy read the other posts
First of all, let me clarify that I know you cannot have actual abstract
First of all, this isn't for a keylogger, it's for an input in a
first of all some details: I configured security as below in web.xml view plaincopy
First of all, I'm quite new to the Android and JAVA world (coming from
first of all i would like to say i know its probably an easy
First of all there is probably a question like this already but i couldn't
First of all, apologize because I have seen some posts about this, but I
First of all I want to mention two things, One: My code isn't perfect

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.