Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

On Compilation getting error "Package System doesn't exist"  RSS feed

 
Arpan Saini
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just starting reading java online by Headfirstjava
While trying to compile my First java program by command Prompt getting the following error

"Package System Doesn't exist"

Please help to compile my First Program so i can go ahead
 
Ganesh Patekar
Bartender
Posts: 696
23
Eclipse IDE Hibernate Java jQuery MySQL Database Netbeans IDE Oracle Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch! , please post your code so we can help you properly, to post code use code tag from above menus. Just enclose your code with code tag which will appear like below example. Use preview before sumbitting.

  • Example of code posted using code tag:

  •  
    Jeanne Boyarsky
    author & internet detective
    Sheriff
    Posts: 37222
    519
    Eclipse IDE Java VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Also, note that System is a class in the java.lang package which is imported by default. So you don't need to write anything for importing it.
     
    Campbell Ritchie
    Marshal
    Posts: 55672
    161
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Welcome again

    I presume you are triyng to import the System class or statically import one of its methods. Remember all imports require you name the package before the class. Write
    import nameOfPackage.ClassNeme;
    or
    import static packageName.NameOfClass.nameOfStaticMember;
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!