Skip to content

Can't run iosTest test from IntelliJ - "No JDK Specified" error #350

Open
@kirillzh

Description

@kirillzh

Kotest 6.0.0.M2
Kotlin 2.1.0
IJ 2024.3.3
Kotest IJ plugin 1.3.92-2024.3.1

Steps:

  1. Open project with KMP iOS tests (iosTest source set)
  2. Click on run gutter icon next to class in IDE
  3. See No JDK Specified popup (see full IDE logs below):
Image

Notes:

  • running gradle iosSimulatorArm64Test from CLI works fine and passes tests.
  • when right clicking on iosTest source set itself (or any enclosing packages) and running tests from IDE window, it seems to work just fine
Image

No JDK Specified full IDE logs:

2025-02-25 11:15:03,007 [4837668]   WARN - #c.i.d.i.RemoteConnectionBuilder - Capture agent is not supported for JRE null
2025-02-25 11:15:03,007 [4837668]   INFO - #c.i.e.r.ExecutionUtil - Error running 'GreetingTest (2)':<br>No JDK specified
com.intellij.execution.CantRunException: No JDK specified
	at com.intellij.openapi.projectRoots.JdkCommandLineSetup.setupJavaExePath(JdkCommandLineSetup.kt:220)
	at com.intellij.openapi.projectRoots.JdkUtil.setupJVMCommandLine(JdkUtil.java:124)
	at com.intellij.execution.configurations.SimpleJavaParameters.toCommandLine(SimpleJavaParameters.java:214)
	at com.intellij.execution.configurations.JavaCommandLineState.createTargetedCommandLine(JavaCommandLineState.java:186)
	at com.intellij.execution.JavaTestFrameworkRunnableState.createTargetedCommandLine(JavaTestFrameworkRunnableState.java:262)
	at com.intellij.execution.configurations.JavaCommandLineState.prepareTargetEnvironmentRequest(JavaCommandLineState.java:118)
	at com.intellij.execution.JavaTestFrameworkRunnableState.prepareTargetEnvironmentRequest(JavaTestFrameworkRunnableState.java:233)
	at com.intellij.execution.runners.ExecutionEnvironment.prepareTargetEnvironment(ExecutionEnvironment.java:149)
	at com.intellij.execution.runners.ExecutionEnvironment.getPreparedTargetEnvironment(ExecutionEnvironment.java:131)
	at com.intellij.execution.JavaTestFrameworkRunnableState.createHandler(JavaTestFrameworkRunnableState.java:156)
	at com.intellij.execution.JavaTestFrameworkRunnableState.execute(JavaTestFrameworkRunnableState.java:295)
	at com.intellij.execution.impl.DefaultJavaProgramRunner.executeJavaState(DefaultJavaProgramRunner.java:188)
	at com.intellij.execution.impl.DefaultJavaProgramRunner.lambda$doExecuteAsync$5(DefaultJavaProgramRunner.java:172)
	at com.intellij.execution.target.TargetEnvironmentAwareRunProfileState$1.run(TargetEnvironmentAwareRunProfileState.java:58)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:491)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$7(CoreProgressManager.java:542)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:249)
	at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:223)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:45)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:222)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:674)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:749)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:705)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:673)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:203)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:249)
	at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:502)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:467)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:103)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:103)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:109)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:103)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:463)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions