By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,783 Members | 1,154 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,783 IT Pros & Developers. It's quick & easy.

help

P: n/a
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

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"Gary Redmond" <gr@iol.ie> wrote in message
news:z2******************@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
Jul 17 '05 #2

P: n/a
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

Jul 17 '05 #3

P: n/a
system should be System, java is case-sensitive
"Gary Redmond" <gr@iol.ie> bl news:z2******************@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

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.