| Author |
Basic compile problem: cannot find symbol
|
Stan Lederer
Greenhorn
Joined: Sep 24, 2012
Posts: 26
|
|
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
Joined: Apr 06, 2010
Posts: 3793
|
|
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
Greenhorn
Joined: Sep 24, 2012
Posts: 26
|
|
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
Joined: Apr 06, 2010
Posts: 3793
|
|
You need to import the contents of the package. So import com.Ostermiller.util.CSVParser or com.Ostermiller.util.*
|
 |
Stan Lederer
Greenhorn
Joined: Sep 24, 2012
Posts: 26
|
|
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.
|
 |
 |
|
|
subject: Basic compile problem: cannot find symbol
|
|
|