Article View: borland.public.jbuilder.java.language
Article #8517CLASSPATH
From: Harry J. Kobetitsch
Date: Sun, 18 Mar 2001 04:15
Date: Sun, 18 Mar 2001 04:15
47 lines
2439 bytes
2439 bytes
I am running Windows 2000 and I am using the Java 2 SDK and
Forte 2.0. I also used Command Prompt and using javac from the
command line and I get the same type of problem.
I have set CLASSPATH to C:\Harry\Java
I have the following two classes that I am trying to build
Other.class and OtherTest.class
Other.java contains:
-----------------------------------------------
// Creating a package
package com.kobet.samples;
public class Other {
public Other() {
System.out.println("com.kobet.samples.Other");
}
}
OtherTest.java contains:
---------------------------------------------------
import com.kobet.samples.*;
public class OtherTest {
public static void main(String[] args) {
Other o = new Other();
}
}
I compile Other.java and I put the resulting Other.class in
C:\Harry\Java\com\kobet\samples
When I try to compile OtherTest.java I get the following error
messages:
In Forte 2.0
OtherTest.java [2:1] Package com.kobet.samples. not found in import.
import com.kobet.samples.*;
^
1 error
When I use the command line I get what looks like a good compile
of OtherTest.class but when I run
java OtherTest
I get the following message:
Exception in thread "main" java.lang.NoClassDefFoundError: OtherTest
Do I have the CLASSPATH set up correctly?
Technical Details
Message-ID:
<991cm4$i8t$1@slb7.atl.mindspring.net>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113ae9,21ace6450f42c0b,start X-Google-Attributes: gid113ae9,public X-Google-Thread: 10a146,21ace6450f42c0b,start X-Google-Attributes: gid10a146,public X-Google-Thread: f74b3,21ace6450f42c0b,start X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-17 20:16:04 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: "Harry J. Kobetitsch" <kobet@ix.netcom.com> Newsgroups: borland.public.jbuilder.java.language,comp.lang.java.help,comp.lang.java.programmer Subject: CLASSPATH Date: Sat, 17 Mar 2001 22:15:08 -0600 Organization: MindSpring Enterprises Lines: 54 Message-ID: <991cm4$i8t$1@slb7.atl.mindspring.net> NNTP-Posting-Host: cf.dc.b4.86 X-Server-Date: 18 Mar 2001 04:13:56 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700