title: Kotlin: Unresolved reference: javaClass
body: <p>I'm hoping someone has come across the issues that i'm seeing while building my java/Kotlin project.
  The project is interop with java and kotlin, with the following versions:</p>
  
  <ul>
  <li>Jdk 1.7</li>
  <li>Kotlin 0.9.66</li>
  <li>Gradle (wrapper) 2.0</li>
  </ul>
  
  <p>Kotlin has been compiling fine prior to a few changes i made i.e.  converted a few java classes to equivalent kotlin versions.</p>
  
  <p>Here are the errors that i'm seeing:</p>
  
  <pre><code>  c:\projects\myproject&gt;gradlew  :java:workspace:models:compileKotlin  --stacktrace     :java:workspace:models:compileKotlin
  
  w: Annotations path entry points to a non-existent location:
  C:\projects\myproject\java\workspace\models\annotations
  
  e: C:\projects\CustomerProfileEmail.kt: (15, 32): Unresolved reference: toLowerCase
  e: C:\projects\CustomerProfilePhone.kt: (34, 22): Unresolved reference: equalsIgnoreCase
  e: C:\projects\Account.kt: (17, 21): Unresolved reference: javaClass
  e: C:\projects\Account.kt: (18, 21): Unresolved reference: javaClass
  e: C:\projects\Account.kt: (31, 15): Unresolved reference: indexOf
  e: C:\projects\Account.kt: (35, 15): Expression 'length' of type 'kotlin.Int' cannot be invoked as a function. The function invoke() is not found
  e: C:\projects\Account.kt: (39, 15): Expression 'length' of type 'kotlin.Int' cannot be invoked as a function. The function invoke() is not found
  e: C:\projects\Balance.kt: (10, 21): Unresolved reference: javaClass
  e: C:\projects\Balances.kt: (12, 21): Unresolved reference: firstOrNull
  e: C:\projects\Balances.kt: (12, 35): Cannot infer a type for this parameter. To specify it explicitly use the {(p : Type) -&gt; ...} notation
  e: C:\projects\Debit.kt: (7, 12):Unresolved reference: javaClass
  e: C:\projects\ProgramR.kt: (12, 21): Unresolved reference: javaClass
  e: C:\projects\ProgramR.kt: (13, 21): Unresolved reference: javaClass
  e: C:\projects\Transaction.kt: (7, 12): Unresolved reference: javaClass
  e: C:\projects\Transaction.kt: (7, 40): Unresolved reference: javaClass
  e: C:\projects\Adjustment.kt: (13,21): Unresolved reference: javaClass
  e: C:\projects\Reward.kt: (12, 24): Unresolved reference: javaClass
  :java:workspace:models:compileKotlin FAILED
  
  FAILURE: Build failed with an exception.
  </code></pre>
  
  <p>Here is an example of the source code:</p>
  
  <pre><code>import javax.xml.bind.annotation.*
  
  XmlAccessorType(XmlAccessType.FIELD)
  XmlType
  XmlSeeAlso(javaClass&lt;LoyaltyCredit&gt;(), javaClass&lt;Debit&gt;())
  public open class Transaction: TransactionParent(){
      public var account: Account? = null
      public var balances: Balances? = null
      public var rewards: Rewards? = null
  }
  </code></pre>
  
  <p>Gradle script</p>
  
  <pre><code>repositories {
      mavenCentral()
  }
  
  buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.connorgarvey.gradle:gradle-grails-wrapper:1.0'
          classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.9.66'
          classpath 'org.jetbrains.kotlin:kotlin-stdlib:0.9.66'
      }
  }
  
  apply from: 'build/includes.gradle'
  </code></pre>
  
  <p>I have already seen this: <a href="https://devnet.jetbrains.net/message/5478050">https://devnet.jetbrains.net/message/5478050</a> didn't help.</p>
  
  <p>Any help would be greatly appreciated!</p>