Results 1 to 2 of 2

Thread: compile error

  1. #1
    angryredantz is offline Member
    Join Date
    Jan 2009
    Posts
    6
    Rep Power
    0

    Default compile error

    Hi this is my first official post in this forum.

    I'm using java jdk-1.6 on gentoo linux

    I got this two files:
    Java Code:
    /*************************************************************
    Name:TwoClasses.java
    Date:1/23/09
    Author:angryredantz
    **************************************************************/
    public class TwoClasses extends Subclass
    
    {
      public static void main(String[] args)
      {
        System.out.println("From the main class");
        sub();
      }
      
    }
    Java Code:
    /*************************************************************
    Name:SubClass.class
    Date:1/23/09
    Author:angryredantz
    **************************************************************/
    class Subclass
    {
      public static void sub()
      {
        System.out.println("From the sub class");
      }
    
    }
    Everytime a try to compile the code I get this error.
    Java Code:
    TwoClasses.java:6: cannot access Subclass
    bad class file: ./Subclass.class
    illegal start of class file
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    public class TwoClasses extends Subclass
    I beleive is that I haven't set correctly the classpath but don't know how, need help please.

  2. #2
    angryredantz is offline Member
    Join Date
    Jan 2009
    Posts
    6
    Rep Power
    0

    Default

    I pretty much figure out the problem
    change Subclass.class to Subclass.java solve it
    my bad

Similar Threads

  1. Compile Error - Please Help!!
    By AJ2009 in forum New To Java
    Replies: 10
    Last Post: 01-04-2009, 03:59 PM
  2. Java 1.5 compile time error
    By ank_k in forum New To Java
    Replies: 4
    Last Post: 11-13-2008, 11:12 AM
  3. doesn't compile?!
    By jon80 in forum New To Java
    Replies: 8
    Last Post: 06-14-2008, 05:42 PM
  4. Not able to compile
    By bugger in forum New To Java
    Replies: 2
    Last Post: 01-09-2008, 10:13 PM
  5. compile error
    By dirtycash in forum New To Java
    Replies: 6
    Last Post: 12-12-2007, 06:00 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
  •