J. Wall

Greenhorn
+ Follow
since Nov 12, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by J. Wall

I'm still messing around with packages in Netbeans and now I have this error:
java.lang.NoClassDefFoundError: cfparser (wrong name: com/wallinternet/cfBrowser/cfparser)
at java.lang.ClassLoader.defineClass0(Native Method)
first couple of lines in the file are:
package com.wallinternet.cfBrowser;
import java.util.*;//import util for lists and iterators
import java.io.*;//import io for file class
import java.net.*;//import net for URL class
public class cfparser
{

The file lives in e:\javawork\com\wallinternet\cfBrowser\
My classpath (mounted filesystems) contains:
e:\javawork\com\wallinternet\cfBrowser
e:\javawork
I've run the class successfully from this command line:
E:\javawork\java com.wallinternet.cfBrowser.cfparser
(no classpath set)

Thanks,
Justin
You gave me the right idea, Thanks! I had to mount (add to classpath) the com directory, not the cfBrowser directory.

Originally posted by Dirk Schreckmann:
The compiled class files need to reside in a directory structure that matches the package declaration and the root of the directory structure needs to be findable (if that's a word - probably not) through the classpath. Is the idea of adjusting the classpath new for you?

22 years ago
My directory structure is this:
E:\javawork\com\wallinternet\cfBrowser\
My package line reads:
package com.wallinternet.cfBrowser;
(as long as I comment this out, everything complies)
My main method is in cfParser.java in the cfBrowser directory
I'm using NetBeans, so my classpath are the mounted directories and Jars. I've mounted E:\javawork\com\wallinternet\cfBrowser\ along with 2 jars and a directory that holds files I'm parsing. Maybe I should have the properties of the last directory set false for use in execution, compiling, and debugging....
Thanks for the help,
Justin

Originally posted by Dirk Schreckmann:
The compiled class files need to reside in a directory structure that matches the package declaration and the root of the directory structure needs to be findable (if that's a word - probably not) through the classpath. Is the idea of adjusting the classpath new for you?

22 years ago
I've put a package line into all of my classes, and now the classes can't find each other. I'm putting some static methods in a utilities class (is this correct design?). Here's the error:
cfFile.java [44:1] cannot resolve symbol
symbol : variable utilities
location: class com.wallinternet.cfBrowser.cfFile
code = utilities.readFile(newfile);

Thanks,
Justin
22 years ago