Results 1 to 8 of 8

Thread: Compile Problem

  1. #1
    Alexm92 is offline Member
    Join Date
    Sep 2015
    Posts
    9
    Rep Power
    0

    Default Compile Problem

    Can anyone give me any insight as to why this wont compile?

    Compile Problem-2015-09-17-13_14_43-jcreator-addition.java-.png

    Im sure the code is right because my lecturer gave me the java program and it compiles when I open the java file he gave me, but when I type my own or copy and paste his it gives me those errors. Im thinking its a problem with the compiler or something but I am new to programming so I dont know.

    Any help would be appreciated. Thanks in advance.

    Alex

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Compile Problem

    why this wont compile?
    Please copy the full contents of the error messages and paste it here.
    Also copy the text of the source code and paste it here. Be sure to wrap the code in code tags.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Alexm92 is offline Member
    Join Date
    Sep 2015
    Posts
    9
    Rep Power
    0

    Default Re: Compile Problem

    Java Code:
    class Addition  
    
    // Student Name : 		Enda Dunican
    // Student Id Number : 	COM1234
    // Date :				1/9/2005
    // Purpose : 			A simple addition program
    
    
     
    {
        public static void main(String[] args)
        
    	{
    
    		int number1; 
    	    int number2;
    	    int sum; 
    	    		
    		System.out.print("Enter the first number ->  "); 
    		number1 = EasyIn.getInt();
    		System.out.print("Enter the second number ->  ");
    		number2 = EasyIn.getInt(); 
    		sum = number1 + number2; // Calculate sum
    	    System.out.println("The sum of the two numbers is " + sum); 
    	  
    	}
    }
    Error Message: Not quite sure how to get the full contents of the error message?

    Edit: When I execute the code I get an error in the cmd saying Could not find or load main class Addition
    Last edited by Alexm92; 09-17-2015 at 02:51 PM.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: Compile Problem

    What is 'EasyIn'? The compiler can't find it either, so it starts to complain; it is designed like that ...

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: Compile Problem

    I believe the problem is that you still have errors. Where is the EasyIn class? The compiler was complaining about it in the graphic.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    Alexm92 is offline Member
    Join Date
    Sep 2015
    Posts
    9
    Rep Power
    0

    Default Re: Compile Problem

    I dont know what EasyIn is. This is the code my lecturer gave me. Should i define a class called EasyIn? Or should I remove it?

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Compile Problem

    This is the code my lecturer gave me.
    Ask your instructor where you can get that class. The code uses it to read user's input.
    If you don't understand my response, don't ignore it, ask a question.

  8. #8
    Alexm92 is offline Member
    Join Date
    Sep 2015
    Posts
    9
    Rep Power
    0

    Default Re: Compile Problem

    Quote Originally Posted by Norm View Post
    Ask your instructor where you can get that class. The code uses it to read user's input.
    Ok thanks ill ask him. Thanks for your time.

Similar Threads

  1. problem after to compile
    By rayban in forum New To Java
    Replies: 2
    Last Post: 06-21-2015, 12:21 AM
  2. Replies: 2
    Last Post: 03-28-2015, 08:04 AM
  3. fix this problem to compile the code
    By Tarasj in forum Java Servlet
    Replies: 2
    Last Post: 05-31-2012, 09:57 AM
  4. Problem with compile Calendar
    By santunez in forum New To Java
    Replies: 1
    Last Post: 05-06-2010, 12:36 AM
  5. compile problem
    By chrisbremen in forum New To Java
    Replies: 8
    Last Post: 11-13-2008, 06:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •