title: Java Case Sensitivity: Class file collision: A resource exists with a different case
body: <p>I am in Windows OS, working in eclipse IDE, I have following two scenario:</p>
  
  <p><strong>1. I have created below class, this is in Employee.java class (E is in uppercase):</strong></p>
  
  <pre><code>public class Employee {
      public static void main(String[] args) {
          employee emp = new employee();
          emp.test();
      }
  }
  
  //here e is in lowercase
  class employee {
      public void test() {
          System.out.println("I am in test()");
      }
  }
  </code></pre>
  
  <p>In this case I got below Exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: employee (wrong name: Employee)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
  .
  .
  .
  at Employee.main(Employee.java:4) // i.e at emp.test();
  </code></pre>
  
  <p><strong>2. I have created below class, this is Employee.java class:</strong></p>
  
  <pre><code>public class Employee {
      public static void main(String[] args) {
  
      }
  }
  </code></pre>
  
  <p>Now when I tried to create employee.java (e is in lower case) class in same package, I got the message in eclipse that  <strong><code>Type with same name but different case exists.</code></strong></p>
  
  <p>My question is: Java is case sensitive. Does this means JVM (windows and UNIX based) is case sensitive or the compiler is case sensitive? And why it gives that exception in scenario 1 and eclipse does not allow me to create employee.java file in same location in scenario 2.</p>
  
  <p>Also remember I am on Windows OS which is case insensitive for file name, so I know that it will not allow employee.java and Employee.java in same location. <strong>Does this violate in any means Java case sensitivity?</strong></p>