title: Accessing scala object fields from java
body: <p>I'm having trouble accessing the fields of a scala object from java.</p>
  
  <p>Scala:</p>
  
  <pre><code>object TestObject {
    val field = 5 
  }
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>public class JavaTest
  {
    public static void main(String[] args)
    {
      int i = TestObject.field;
    }
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>[error] JavaTest.java: cannot find symbol
  [error] symbol  : variable field
  [error] location: class TestObject
  [error]     int i = TestObject.field;
  </code></pre>