• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Basic compile problem: cannot find symbol

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic