DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2006
    Posts
    4

    Question I am having troble Compilng a program

    Hi,
    I am new to Java, and am trying to run the smiple program in a book I got.
    This is the programI am trying to run.
    public class Saluton {
    public static void main (String[] arguments){
    System.out.println(greeting);
    }
    }

    This is what I get:
    C:\javaSol>Javac Salution.java
    error: cannot read : Salution.java

    Also, I set up the path and Class evionment variables like the book said, but I am wondering if something is wrong there anyway.

    my ClassPath = .;C:\Program Files\Java\jdk1.5.0_08\lib\tools.jar
    My Path = ;C:\Program Files\Java\jdk1.5.0_08\bin
    I not sure what they mean they cannot read: Saluton.java? or what to do about it. this is reallly discouraging, I have been trying to get this simple program to compile and I am not even at the run part yet.

  2. #2
    Join Date
    Sep 2006
    Posts
    4
    I'm fairly new to Java as well, but is the file name called Salutation too? I know that if you have public class Salution in a basic program and the file name you're working with isn't the same as Salutation you'll run into problems, at least with JCreator which is the compiler I use.
    You know your game is in trouble when...
    1) your publisher's newsletter lists your title as 2 player split screen...and that's news to you
    2) your boss hopes an ex-employee stole a copy of the game source...because nobody else still has it
    3) you see the phrase "Hello World!" pop up on the lead developer's console
    4) asked where the design spec is, the director replies "In my head"
    5)your game's AI is offered a better paying job than you.

  3. #3
    Join Date
    Jun 2006
    Posts
    4
    yes I did not write it right here, but in the actual files they are the same.
    Last edited by itm; 09-23-2006 at 11:23 PM.

  4. #4
    Join Date
    Jun 2006
    Posts
    4
    I have been trying to solve this for weeks now. Has any one else had problems comiling programs like this in java?

  5. #5
    Join Date
    Sep 2006
    Posts
    4
    If you are new, I recommend you to use a developer tool which will help you compile programs. You can visit this site http://www.scad.co.nr for a step by step guide on how to do this.

  6. #6
    Join Date
    Oct 2006
    Posts
    2
    On command line you typed: "javac Salution.java"
    You should type: "javac Saluton.java"

    Class name must be the same as file name, and it is also case sensitive.

Similar Threads

  1. soft drink Vending machine program
    By divagoddess in forum C++
    Replies: 5
    Last Post: 08-14-2009, 03:12 PM
  2. Replies: 3
    Last Post: 06-19-2005, 02:38 PM
  3. problem in program in c++
    By mheasen in forum Architecture and Design
    Replies: 0
    Last Post: 03-20-2002, 09:24 AM
  4. Please help with running executable vb program.
    By Gordon Reichhardt in forum VB Classic
    Replies: 2
    Last Post: 01-08-2002, 10:06 AM
  5. How can I build copy protection into my program
    By W.Pierce in forum VB Classic
    Replies: 1
    Last Post: 12-11-2001, 08:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links