Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using a CSV Parser class

843810Jan 31 2005 — edited Feb 9 2005
Ok so I've been wrestling with the issue of CLASSPATH and packages for the last week or so, and I'm truely, completely fed up. Maybe there's a kind soul to show me my mistake?

Here's the code
import java.io.*;
import com.Ostermiller.util.*;

public class Extractor {
	public static void main ( String args[] )
	{
		// Create the printer
		ExcelCSVPrinter ecsvp = new ExcelCSVPrinter( System.out );
		// Write to the printer
		try {
			ecsvp.writeln( new String[]{"hello","world"} );
		} catch (IOException iox){
			System.out.println("IO error");
	}

	}
} 
So, I'm importing the java packages and the Ostermiller utils. I simply create a ExcelCSVPrinter instance and I tell it to write out the string array Hello World.

Now this compiles fines, using javac -cp c:\docume~1\britt\mydocu~1\ostermillerutils_1_04_03.jar Extractor.java

But when it try to java Extractor, I get the classic "NoClassDefFound Extractor" error. Even, if I include the same classpath which works for compiling, it still is a no-go.

I have the feeling this is a very basic mistake I'm making here, but I just can't see it.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2005
Added on Jan 31 2005
4 comments
164 views