title: Java 7 switch statement with strings not working
body: <p>According to <a href="http://download.oracle.com/javase/tutorial/java/nutsandbolts/switch.html" rel="noreferrer">The Java Tutorials</a>, in <a href="http://jdk7.java.net/download.html" rel="noreferrer">Java SE 7</a> and later, you can use a String object in the switch statement's expression. </p>
  
  <pre><code>String s = ...
  switch(s){
      //do stuff
  }
  </code></pre>
  
  <p>But is this true? I've installed the JRE and added it to the build path of my Eclipse project, but I'm getting the following compile-time error: </p>
  
  <blockquote>
    <p>Cannot switch on a value of type
    String. Only convertible int values or
    enum constants are permitted</p>
  </blockquote>
  
  <p>Also, I think I've got it configured correctly since I was able to use its <code>java.nio.file.Files</code> class, as well as <code>JLayer</code>.</p>
  
  <p>Any ideas?</p>