Reputation: 469
I have created an application (which runs fine in Eclipse), but will not run within IntelliJ IDEA. Every time, it builds and then exits with the error: Error running Application: 'IntelliJ IDEA IU-163.9166.29' is not a valid JRE home
.
Within IntelliJ I have an SDK set up: 1.8, pointing to /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
Upvotes: 7
Views: 10046
Reputation: 5495
You can solve that by two steps :
Step One :
File
-> Project Structure
-> Make Sure from project SDK
Step Two :
Go to Application name next of run button then click to drop down list and select Edit Configuration
.
Upvotes: 2
Reputation: 469
After some messing around within the IDE, I have found out that, within the Run/Debug Configurations screen, there was a setting to set the JRE. This wasn't set to the correct value, so the program wasn't running. Upon changing it to the correct value, it worked.
Upvotes: 22