will compile but can find other classes

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
ravana
Posts: 1
Joined: Mon May 26, 2003 11:08 am

will compile but can find other classes

Post by ravana »

When i compile my programs at tafe, it has no trouble find other classes "the ones i plan to instansinate"

but on my home computer, it can only find the file im working on and can see the other classes even thou they are in the same directory...


can anyone help please?
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Check whether your CLASSPATH environment variable contains the . (a single dot)
SpaceKidA
Posts: 3
Joined: Mon May 26, 2003 11:08 pm

Post by SpaceKidA »

Okay, I keep seeing your suggestion, MudGuard, to add a . or ;.; or something similar to CLASSPATH, but so far I haven't seen a good description of what CLASSPATH is exactly or how to modify it.

I have the same problem as ravana, in that I can compile all day long, but when it comes time to run a java application, I get the error
Exception in thread "main" java.lang.NoClassDefFoundError: (class name) :evil:

So how exactly do I add a . to this mysterious CLASSPATH that everyone's talking about?
SpaceKidA
Posts: 3
Joined: Mon May 26, 2003 11:08 pm

Post by SpaceKidA »

Okay I finally found directions for this procedure at http://www.textpad.com/support/faq/java.html (the TextPad FAQ, which I had not used yet -- DO'H!).
jcwolff
Posts: 1
Joined: Wed Aug 06, 2003 3:10 am

cannot find .class files in the current directory

Post by jcwolff »

So, I have ".;" as the first item in the classpath. I even stuck the full path string into the classpath but I still get:
--------------------
C:\Documents and Settings\jwolff\Application Data\TextPad\RationalSortTester.java:82: class Rational is public, should be declared in a file named Rational.java
public class Rational implements Comparable
^
1 error

Tool completed with exit code 1
--------------------

My classpath is:".;cs2.jar;C:\Program Files\Java\j2re1.4.0\lib\ext\QTJava.zip;D:\share\dwolff;"

the Relational class is indeed in Relational.java, in the same directory as the RelationalTester.java is and compiled correctly not 3 seconds before I get the message included above.

So, what am I doing wrong?
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Re: cannot find .class files in the current directory

Post by jeffy »

Rational != Relational

You are working too hard. Take a nap. :' )
Post Reply