File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang package is not importing by default

 
ravi kanth
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 823
Chrome Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posting the code along with the problem would be great.
Thank you.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't usually need to set a classpath for a beginner's application.
 
ravi kanth
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi this my Code:
[edit]Add code tags[/edit]
[ November 25, 2008: Message edited by: Campbell Ritchie ]
 
Campbell Ritchie
Sheriff
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic