Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Missing class file

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Missing class file

    After an unintended break, I'm back to learning Java.

    I'm having a problem debugging the following file. I keep getting the message: "The following file is missing class or inner class files." I'm sure I'm missing something very simple. But what is it? I'm still working on fixing the rest of the file.



    public class Oops2 {
    public static void main(String[] args) {

    int x;
    x = 0;
    System.out.println ("x is "),x;

    int x;
    x = 15; // set x to 15
    System.out.println ("x is now "x);

    int y; // set y to 1 more than x
    y = x+1;
    System.out.println ("x and y are "x + and + y);
    }
    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,623
    Thanks
    45
    Thanked 1,958 Times in 1,932 Posts

    Default Re: Missing class file

    I keep getting the message: "The following file is missing class or inner class files."
    Please copy the full text of the error messages and paste it here.

    Please edit your post and wrap your code with code tags:
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Nov 2012
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Missing class file

    Sorry about the formatting error, Norm. I think I have it fixed:

    Here's the complete error message:

    The following file is missing class or inner class files: "/Users/Mike/Java Chapter 2/Oops2.java" Proceeding before correcting this is not recommended.

       public class Oops2 {
          public static void main(String[] args)  {
     
             int x;
             x = 0;
             System.out.println ("x is "),x;
     
             int x;
             x = 15;  // set x to 15
             System.out.println ("x is now "x);
     
             int y;  // set y to 1 more than x
             y = x+1;
             System.out.println ("x and y are "x + and + y);
          }
       }

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,623
    Thanks
    45
    Thanked 1,958 Times in 1,932 Posts

    Default Re: Missing class file

    I've never seen that style of error message.
    What program are you executing to get that message?

    Do you get any error messages from the javac compiler?
    The message should show the source with a ^ under the location of the error.
    Here is a sample from the javac compiler:
    TestSorts.java:138: cannot find symbol
    symbol  : variable var
    location: class TestSorts
             var = 2;
             ^
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Nov 2012
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Missing class file

    I'm using jGrasp to do the programming, but I'm starting from a web page called "Practice-It!" (I'm working from a textbook called "Building Java Programs: A Back to Basics Approach.") I've attached two screenshots: 1) the web page that gives the practice question; 2) the error message as it appears on jGrasp.

    Image 1.jpgImage 2.jpg

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,623
    Thanks
    45
    Thanked 1,958 Times in 1,932 Posts

    Default Re: Missing class file

    What does the posted code have to do with the title of this thread?

    I don't know anything about how JGrasp works.

    Are you trying to compile the code shown in post#3?
    Can you use the javac command from the JDK to compile the code so that normal error messages are created?
    The Posted images are not readable.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Nov 2012
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Missing class file

    I figured out what I was doing wrong. Thanks for your time.

Similar Threads

  1. Replies: 3
    Last Post: December 2nd, 2012, 10:18 PM
  2. Replies: 3
    Last Post: June 17th, 2012, 06:22 PM
  3. Can't compile .java file in JDeveloper due to missing files
    By javanewbie2 in forum Java Theory & Questions
    Replies: 4
    Last Post: July 7th, 2011, 10:22 AM
  4. Replies: 5
    Last Post: November 13th, 2010, 12:53 PM
  5. Missing Substance file
    By ma05k1 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 4th, 2010, 05:22 PM