| Author |
java.lang package is not importing by default
|
ravi kanth
Ranch Hand
Joined: Jun 04, 2008
Posts: 36
|
|
Hi All, i am new to java. in my Sample Code i am getting this compilation error,even after setting path,classpath too, " file does not contain class String please remove are make sure it appears in the correct subdirectoryof the classpath " Thanks & regards raja.
|
 |
sudipto shekhar
Ranch Hand
Joined: Apr 02, 2008
Posts: 813
|
|
Posting the code along with the problem would be great. Thank you.
|
Regards, Sud.
SCJP 5 ScjpFAQ JLS
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32663
|
|
|
You don't usually need to set a classpath for a beginner's application.
|
 |
ravi kanth
Ranch Hand
Joined: Jun 04, 2008
Posts: 36
|
|
Hi this my Code: [edit]Add code tags[/edit] [ November 25, 2008: Message edited by: Campbell Ritchie ]
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32663
|
|
Please always Use Code Tags; I have added them so you can see how much better your post looks. I haven't seen that error before. Please check your PATH is correct. Please check you don't have any Java installation folders in your CLASSPATH; for a simple application like that it is not necessary to have anything in your CLASSPATH at all. If you have a decent internet connection, try reinstalling Java and update the PATH if you have a new installation location.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12921
|
|
What is the name of your source file? Did you call it String.java? That doesn't work. In Java, the source file must have the name of the public class (or interface) in the file, so if you have a public class MyThread then the source file must be named MyThread.java.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: java.lang package is not importing by default
|
|
|