Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic compile problem: cannot find symbol

 
Stan Lederer
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,

I found a nice CSV parser at http://ostermiller.org/. I downloaded the zip file, unzipped it, and I now have a jar file and a test program to use it. But I can't get my test program to compile.

Here's the test program.



Here's my compile statement:


The jar file does exist in the path.

Here's the error I get:
CSVTester.java:6: cannot find symbol
symbol : variable CSVParser
location: class CSVTester
String[][] values = CSVParser.parse(
^
1 error

What am I doing wrong? Do I need to import the package? If so, how do I determine its name?

Thanks very much.
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you need to import it. To find out the package, look at the documentation (or dig around in the Jar file, but the documentation should cover it).

A quick look at the site you linked to shows this: http://ostermiller.org/utils/javadoc/CSVParser.html, which says the package is called com.Ostermiller.util.
 
Stan Lederer
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Brown wrote:Yes, you need to import it. To find out the package, look at the documentation (or dig around in the Jar file, but the documentation should cover it).

A quick look at the site you linked to shows this: http://ostermiller.org/utils/javadoc/CSVParser.html, which says the package is called com.Ostermiller.util.

Hi,

I tried importing com.Ostermiller.util but I get this error:

CSVTester.java:2: package com.Ostermiller does not exist
import com.Ostermiller.util;
^
CSVTester.java:7: cannot find symbol
symbol : variable CSVParser
location: class CSVTester
String[][] values = CSVParser.parse(
^
2 errors
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to import the contents of the package. So import com.Ostermiller.util.CSVParser or com.Ostermiller.util.*
 
Stan Lederer
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Brown wrote:You need to import the contents of the package. So import com.Ostermiller.util.CSVParser or com.Ostermiller.util.*

Excellent, Matthew, That did it. Thank you. Now I get an error about an unreported exception but I think I know how to deal with that.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic