title: How to access Java Enums from Javascript (Java 1.8)
body: <p>In Java 1.7, prior to it's removal, one could use 'Packages' to access Java Enums in the following way from Javascript on an HTML page viewed a browser:</p>
  
  <pre><code>var enumvar1 = document.appletid.Packages.com.mycompany.MyClass$MyEnumYesNo.YES
  var enumvar2 = document.appletid.Packages.com.mycompany.MyClass$MyEnumYesNo.NO
  </code></pre>
  
  <p>I'm upgrading these HTML pages to use Java 1.8 (which now uses the Nashorn javascript engine), and I cannot seem to figure out how to access the Enum members.  </p>
  
  <p>I've rewritten the Java applet to return a new MyClass object to a javascript variable, and I can access all the methods and fields in MyClass from the JavaScript variable, but I can't figure out the syntax to get at the Enums.  The errors are of the type "property is null/undefined".  I've tried various combinations of the package name, class name, variable holding the class, and applet ID variable.</p>
  
  <p>I haven't found any examples for Java 1.8 in googling around, although in reading the Nashorn documentation from Oracle, it implies that Enums can be accessed.  </p>
  
  <p>Could someone provide an example syntax?  Probably something simple that I am just overlooking...</p>
  
  <p>Thanks!</p>