aspose file tools*
The moose likes Beginning Java and the fly likes package problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "package problem" Watch "package problem" New topic
Author

package problem

jawwad ahmed
Ranch Hand

Joined: Dec 01, 2001
Posts: 179
Well i am making a simple program
package chatting;
public class Test
{
public static void main(String args[])
{
}
}
where chatting is stored in
c:\chatting\Test.java
and jdk1.3 is installed in
c:\jdk.1.3\bin
i set path like
c:\chatting:>set path=c:\jdk1.3\bin
it compiles well but give the following exception when run.
Exception in thread "main"
java.lang.NoClassDefFoundError: Test (wrong name: cha
Please tell whats wrong.
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
hi,
one way to run this class be in the c prompt. and give
java chatting.Test
it works.
-regards


Sharing is learning
jawwad ahmed
Ranch Hand

Joined: Dec 01, 2001
Posts: 179
well there is still problem giving following exception
Exception in thread "main" java.lang.NoClassDefFoundError: Test/java
Please tell.
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
The PATH is just so your command shell can locate the java.exe binary.
You need to set your classpath variable.
Try
java -classpath C:\ chatting.Test
note the space between the "C:\" and "chatting.Test"
[ February 18, 2002: Message edited by: Rob Ross ]

Rob
SCJP 1.4
Bhushan Jawle
Ranch Hand

Joined: Nov 22, 2001
Posts: 249
Or try running it as "java chatting/Test" from "C:\" if you don't want to set classpath.
It must work.
Regards,
Bhushan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package problem