Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2004

Tip: Looking for answers? Try searching our database.

help my first  java program

Thread view: 
Gary Redmond - 18 Sep 2004 20:32 GMT
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
Adam - 18 Sep 2004 21:12 GMT
>  public class Welcome {
>    public static void main(String[] args){
[quoted text clipped - 11 lines]
>
> what am i doing wrong

The code at the top seems ok, but below it looks like you've spelt 'system'
with a lowercase 's'.
it needs to be System with capital S.

adam
Gary Redmond - 18 Sep 2004 21:34 GMT
the code down below is what the command line is giving back to me

>>  public class Welcome {
>>    public static void main(String[] args){
[quoted text clipped - 18 lines]
>
> adam
Gary Redmond - 18 Sep 2004 21:36 GMT
sorry my mistake it works fine now thanks

> the code down below is what the command line is giving back to me
>
[quoted text clipped - 20 lines]
>>
>> adam
Hal Rosser - 18 Sep 2004 22:19 GMT
> public class Welcome {
>    public static void main(String[] args){
[quoted text clipped - 11 lines]
>
> what am i doing wrong
You should have named the file "Welcome.java" - not Test.java - the file
name and class name should be the same here.
You are compiling "Test.java"
-- by the way, the error message indicates you did not use upper-case S in
"System"
if you rename the file "Welcome.java"
and compile using "javac Welcome.java
you'll hava better luck
=====================


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.