Lorenzo
Lorenzo

Reputation: 89

Run Corda project on IntelliJ

I'm using a MacBook Air OS X 10.9 (Mavericks) and IntelliJ IDEA, but the IDE won't let me execute the test "ProjectImportedOKTest" which is in src/test/java/java_bootcamp/. I followed the exact same steps of this video:

https://www.youtube.com/watch?v=ZgKxjwImKAs&index=3&list=PLi1PppB3-YrVq5Qy_RM9Qidq0eh-nL11N

But for some reason my green arrow to run the test is always disabled. It could be something with the configuration option in the top left of IntelliJ, which I left blank or even something with gradle.

Thanks a lot!!

Upvotes: 0

Views: 439

Answers (3)

R10Lan
R10Lan

Reputation: 1

I ran into the same problem running on Windows and ran into this question trying to find the solution. It turns out Gradle wasn't installed on my machine and that was causing the problems.

According to the Corda Docs - "Gradle - we use 4.10 and the gradlew script in the project / samples directories will download it for you."

However, I installed from the Gradle website here - https://gradle.org/install/#with-a-package-manager -and configured it in the PATH variable. After doing so, my green arrow was enabled and I was able to run the test successfully.

Upvotes: 0

manish
manish

Reputation: 331

You can invalidate the caches of the intelliJ by using the option

  • file -> invalidate caches/Restart.

It helped for me.

Upvotes: 1

Sasa
Sasa

Reputation: 11

There are several things you could try.

  • Ensure that your source java or kotlin folder is marked as "Sources Root". Do this by right clicking the folder and selecting "Mark Directory as"
  • Go to view -> Tool Windows -> Gradle and hit the refresh icon
  • Try opening the project a different way, such as importing the project or just opening the project
  • Rebuild the project and ensure there are no errors
  • Go to File -> Project Structure and ensure Java 1.8 is set as the Project SDK
  • Got to File -> Settings 0> Build, Execution, Deployment and select Gradle. Ensure Gradle JVM has Java 1.8 and that "Use default gradle wrapper" is selected.
  • Again under Settings and Build, Execution, Deployment, go to Compiler -> Kotlin Compiler and check that Target JVM version is set to 1.8

Upvotes: 0

Related Questions