Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2013
    Posts
    108
    Rep Power
    0

    Default Duplicate class files created in some cases

    If you have a look at the attachment, you will see Employee class created only once, but ManageEmployee is created two times and when I delete one copy of ManageEmployee both copies of ManageEmployee get deleted. What is happening?
    Attached Thumbnails Attached Thumbnails Duplicate class files created in some cases-forum.jpg  
    Last edited by suhaas.mohandos@gmail.com; 08-13-2013 at 09:19 AM.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,089
    Rep Power
    4

    Default Re: Duplicate class files created in some cases

    Only you can answer the question "what is happening" because it depends on what you were doing.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Duplicate class files created in some cases

    I'll give you a tip: if you want people to look at images, use a compressed format like PNG or JPG. 3.75 MB is more of my limited bandwidth than I'm willing to invest in looking at a picture that illustrates a post that lacks adequate information.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: Duplicate class files created in some cases

    I'm going for "glitch in Eclipse".
    I'm also going for "don't use the default package".
    Please do not ask for code as refusal often offends.

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default Re: Duplicate class files created in some cases

    Can we see the actual directory structure/contents of directory HibernateExample/src? (no pictures please)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    Join Date
    Aug 2013
    Posts
    108
    Rep Power
    0

    Default Re: Duplicate class files created in some cases

    Employee.java
    Java Code:
    public class Employee {
       private int id;
       private String firstName; 
       private String lastName;   
       private int salary;  
    
       public Employee() {}
       public Employee(String fname, String lname, int salary) {
          this.firstName = fname;
          this.lastName = lname;
          this.salary = salary;
       }
       public int getId() {
          return id;
       }
       public void setId( int id ) {
          this.id = id;
       }
       public String getFirstName() {
          return firstName;
       }
       public void setFirstName( String first_name ) {
          this.firstName = first_name;
       }
       public String getLastName() {
          return lastName;
       }
       public void setLastName( String last_name ) {
          this.lastName = last_name;
       }
       public int getSalary() {
          return salary;
       }
       public void setSalary( int salary ) {
          this.salary = salary;
       }
    }
    ManageEmployee.java
    Java Code:
    public class ManageEmployee {
    
    }

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default Re: Duplicate class files created in some cases

    That is not a directory structure/content; that's a file content.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,089
    Rep Power
    4

    Default Re: Duplicate class files created in some cases

    Ah I spot that the JavaEE perspective is active - that tends to give a distorted view on the project. Click on that 'java' button in the top right to activate the java perspective, things should return to normal then. I always work in the Java perspective, even when working on JEE stuff.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  9. #9
    Join Date
    Aug 2013
    Posts
    108
    Rep Power
    0

    Default Re: Duplicate class files created in some cases

    Are you looking for this?

    HibernateExample->src->(default package)->Employee.java
    HibernateExample->src->(default package)->ManageEmployee.java

    The above file ManageEmployee also present in
    HibernateExample->src->ManageEmployee.java

    HibernateExample->src->Employee.hbm.xml
    HibernateExample->src->hibernate.cfg.xml

  10. #10
    Join Date
    Aug 2013
    Posts
    108
    Rep Power
    0

    Default Re: Duplicate class files created in some cases

    Ah I spot that the JavaEE perspective is active - that tends to give a distorted view on the project. Click on that 'java' button in the top right to activate the java perspective, things should return to normal then. I always work in the Java perspective, even when working on JEE stuff.

    Ah, that worked.

  11. #11
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,089
    Rep Power
    4

    Default Re: Duplicate class files created in some cases

    Nothing was broken, the JavaEE perspective also works; it just provides a different view on the project. One I don't particularly like to be honest.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  12. #12
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: Duplicate class files created in some cases

    Since this turned out to be an IDE-related issue, I've moved it here from New to Java.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Amount of .class files created
    By Lowest0ne in forum Advanced Java
    Replies: 4
    Last Post: 12-03-2012, 04:02 PM
  2. In testing, cases that arenít corner cases are what??
    By cloud9resident in forum Forum Lobby
    Replies: 1
    Last Post: 11-07-2012, 01:48 PM
  3. Replies: 5
    Last Post: 06-03-2012, 07:20 PM
  4. load jar files created with tbc
    By Inbarb in forum Eclipse
    Replies: 0
    Last Post: 02-27-2011, 07:14 AM
  5. Duplicate Files Remover
    By caps_lock in forum New To Java
    Replies: 0
    Last Post: 01-05-2009, 01:31 AM

Posting Permissions

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