GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes please help me to resolve this Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "please help me to resolve this" Watch "please help me to resolve this" New topic
Author

please help me to resolve this

Sid Robin
Ranch Hand

Joined: Nov 24, 2007
Posts: 53
C:\Other Stuff\MyFirst\Threads1.java:10: cannot access Thread
bad class file: .\Excerpt from Java.Lang.Thread.java
file does not contain class Thread
Please remove or make sure it appears in the correct subdirectory of the classpath.
Thread T1 = new Thread(r);
^
Panseer Kaur
Ranch Hand

Joined: Nov 01, 2007
Posts: 44
Can you post more of the actual code?
Pranav Bhatt
Ranch Hand

Joined: Mar 20, 2006
Posts: 284
Can you paste up your program here?
Sergey Petunin
Ranch Hand

Joined: Dec 16, 2007
Posts: 44
Seems like you have a file named Thread.java somewhere on your classpath. It's name conflicts with the java.lang.Thread which is implicitly imported in every Java class.
Sid Robin
Ranch Hand

Joined: Nov 24, 2007
Posts: 53
class TestMyThread extends Thread {


}

****************************************************************************
I Executed the above program and got the error which am facing for the first time Please help me to resolve this
****************************************************************************

C:\Other Stuff\MyFirst\Excerpt from Java.Lang.Thread.java:3: class Thread is public, should be declared in a file named Thread.java
public class Thread implements Runnable
^
C:\Other Stuff\MyFirst\TestMyThread.java:1: cannot access Thread
bad class file: C:\Other Stuff\MyFirst\Excerpt from Java.Lang.Thread.java
file does not contain class Thread
Please remove or make sure it appears in the correct subdirectory of the classpath.
class TestMyThread extends Thread {
^

Tool completed with exit code 1

****************************************************************************
Sergey Petunin
Ranch Hand

Joined: Dec 16, 2007
Posts: 44
Looks like all you have to do is to remove or rename the file
"C:\Other Stuff\MyFirst\Excerpt from Java.Lang.Thread.java"
It's name clashes with the Thread class file name.
Sid Robin
Ranch Hand

Joined: Nov 24, 2007
Posts: 53
Got it guys

Very silly mistake i admit

Thanks a lot dude
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please help me to resolve this