help - Java

This is a discussion on help - Java ; This is my first attempt at java here it is public class Welcome { public static void main(String[] args){ System.out.println("Welcome to java"); } } however when i compile it i get this error C:\Java>javac Test.java Test.java:3: package system does not ...

+ Reply to Thread
Results 1 to 4 of 4

help

  1. Default help

    This is my first attempt at java

    here it is


    public class Welcome {
    public static void main(String[] args){
    System.out.println("Welcome to java");
    }
    }

    however when i compile it i get this error

    C:\Java>javac Test.java
    Test.java:3: package system does not exist
    system.out.println("This is a test");
    ^
    1 error

    what am i doing wrong




  2. Default Re: help


    "Gary Redmond" <gr@iol.ie> wrote in message
    news:z203d.29621$Z14.9769@news.indigo.ie...
    > This is my first attempt at java
    >
    > here it is
    >
    >
    > public class Welcome {
    > public static void main(String[] args){
    > System.out.println("Welcome to java");
    > }
    > }
    >
    > however when i compile it i get this error
    >
    > C:\Java>javac Test.java
    > Test.java:3: package system does not exist
    > system.out.println("This is a test");
    > ^
    > 1 error


    First - I see you tried to compile like so
    javac Test.java
    ***BUT*** your class is named "Welcome"
    your class name needs to be the same as the name of the file.
    You should name the file "Welcome.java"
    then compile with: "javac Welcome.java"
    and the error message indicates you used lower-case "system" in the actual
    "Test.java" file



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.766 / Virus Database: 513 - Release Date: 9/17/2004



  3. Default Re: help

    system should be System, java is case-sensitive
    "Gary Redmond" <gr@iol.ie> ¦b¶l¥ó news:z203d.29621$Z14.9769@news.indigo.ie
    ¤¤¼¶¼g...
    > This is my first attempt at java
    >
    > here it is
    >
    >
    > public class Welcome {
    > public static void main(String[] args){
    > System.out.println("Welcome to java");
    > }
    > }
    >
    > however when i compile it i get this error
    >
    > C:\Java>javac Test.java
    > Test.java:3: package system does not exist
    > system.out.println("This is a test");
    > ^
    > 1 error
    >
    > what am i doing wrong
    >
    >
    >




  4. Default Re: help

    On Sat, 18 Sep 2004 20:31:43 +0100, Gary Redmond wrote:

    > This is my first attempt at java
    >
    > here it is
    >
    >
    > public class Welcome {
    > public static void main(String[] args){
    > System.out.println("Welcome to java");
    > }
    > }
    >
    > however when i compile it i get this error
    >
    > C:\Java>javac Test.java
    > Test.java:3: package system does not exist
    > system.out.println("This is a test");
    > ^
    > 1 error
    >
    > what am i doing wrong


    Looks like line 3 is actually
    system.out.println
    when it should be
    System.out.println

    Java is case sensitive.

    Tony


+ Reply to Thread