Tanish Ranjan
07/17/2024, 8:13 AMTanish Ranjan
07/17/2024, 8:16 AMD:\Development\Intellij\KotlinTest>gradlew sourcesets
Starting a Gradle Daemon, 1 busy and 4 stopped Daemons could not be reused, use --status for details
> Configure project :
Directory 'C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot' (Windows Registry) used for java installations does not exist
FAILURE: Build failed with an exception.
* What went wrong:
Task 'sourcesets' not found in root project 'KotlinTest'.
* Try:
> Run gradlew tasks to get a list of available tasks.
> For more on name expansion, please refer to <https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:name_abbreviation> in the Gradle documentation.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
BUILD FAILED in 54s
I looked into this article: https://discuss.gradle.org/t/gradle-is-trying-to-use-a-jdk-that-has-been-uninstalled-from-my-system/43202
But deleting the available daemons didn't help.
Btw, I am executing the command from the CLI and there is no IDE involved in the process.Tanish Ranjan
07/17/2024, 8:17 AMMartin
07/17/2024, 8:27 AMPATH or JAVA_HOME , double check those environment variablesTanish Ranjan
07/17/2024, 8:55 AMD:\Development\Intellij\KotlinTest>gradlew sourcesets -Dorg.gradle.java.home="C:\Users\ranja\.jdks\openjdk-19.0.1"
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
> Configure project :
Directory 'C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot' (Windows Registry) used for java installations does not exist
FAILURE: Build failed with an exception.
* What went wrong:
Task 'sourcesets' not found in root project 'KotlinTest'.
* Try:
> Run gradlew tasks to get a list of available tasks.
> For more on name expansion, please refer to <https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:name_abbreviation> in the Gradle documentation.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
BUILD FAILED in 18sMartin
07/17/2024, 8:59 AMThomas Broyer
07/17/2024, 9:00 AMThomas Broyer
07/17/2024, 9:01 AMTanish Ranjan
07/17/2024, 10:07 AMmain and test. Then why do we don't have the task sourcesets available?Tanish Ranjan
07/17/2024, 10:09 AMkotlin {
jvmToolchain(19)
}Thomas Broyer
07/17/2024, 10:22 AMsourcesets task, nor any of the built-in plugins.
Use ./gradlew tasks or ./gradlew tasks --all to list the available tasks (for the root project)Vampire
07/17/2024, 12:53 PMsourceSets, not sourcesetsTanish Ranjan
07/17/2024, 1:44 PMsourceSets, not sourcesets
But i retrieved the source sets of other projects using the command gradlew sourcesetsVampire
07/17/2024, 1:45 PMVampire
07/17/2024, 1:45 PM--scan URL?Tanish Ranjan
07/17/2024, 1:45 PMVampire
07/17/2024, 1:46 PMTanish Ranjan
07/17/2024, 1:59 PMTanish Ranjan
07/17/2024, 2:17 PMVampire
07/17/2024, 3:06 PMVampire
07/17/2024, 3:07 PMsourceSets, not sourcesets even if it works.
But the important part is, that this task is coming from the Android Gradle Plugin, not the Kotlin Gradle Plugin, so you can only use it in an Android build unless you create such a task manually or find another plugin that adds such a task for non-Android projects: https://scans.gradle.com/s/f3ap5bczwchl2/timelineTanish Ranjan
07/17/2024, 4:51 PMTanish Ranjan
07/18/2024, 8:24 AMsourceSet property of type SourceSet container . Isn't that what a sourceSet task would return?
D:\Development\Intellij\KotlinTest>gradlew properties
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
Directory 'C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot' (Windows Registry) used for java installations does not exist
> Task :properties
------------------------------------------------------------
Root project 'KotlinTest'
------------------------------------------------------------
_kgp_internal_kotlin_compile_transforms_registered: true
allprojects: [root project 'KotlinTest']
ant: org.gradle.api.internal.project.DefaultAntBuilder@1f851550
antBuilderFactory: org.gradle.api.internal.project.DefaultAntBuilderFactory@33bc0b9a
archivesBaseName: KotlinTest
artifacts: org.gradle.api.internal.artifacts.dsl.DefaultArtifactHandler_Decorated@1dda3c71
asDynamicObject: DynamicObject for root project 'KotlinTest'
autoTargetJvmDisabled: false
base: extension 'base'
baseClassLoaderScope: org.gradle.api.internal.initialization.DefaultClassLoaderScope@3949832f
buildDir: D:\Development\Intellij\KotlinTest\build
buildFile: D:\Development\Intellij\KotlinTest\build.gradle.kts
buildPath: :
buildScriptSource: org.gradle.groovy.scripts.TextResourceScriptSource@19c58725
buildTreePath: :
buildscript: org.gradle.api.internal.initialization.DefaultScriptHandler_Decorated@2edd3ed8
childProjects: {}
childProjectsUnchecked: {}
class: class org.gradle.api.internal.project.DefaultProject_Decorated
classLoaderScope: org.gradle.api.internal.initialization.DefaultClassLoaderScope@2d18d3cf
clean: task ':clean'
compileJava: task ':compileJava'
components: SoftwareComponent container
configurationActions: org.gradle.configuration.project.DefaultProjectConfigurationActionContainer@7d6e0042
configurationTargetIdentifier: org.gradle.configuration.ConfigurationTargetIdentifier$1@311b822a
configurations: configuration container
convention: org.gradle.internal.extensibility.DefaultConvention@4d2d783
crossProjectModelAccess: org.gradle.api.internal.project.DefaultCrossProjectModelAccess@433e023f
defaultArtifacts: extension 'defaultArtifacts'
defaultTasks: []
deferredProjectConfiguration: org.gradle.api.internal.project.DeferredProjectConfiguration@4e5f660a
dependencies: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@23b8a739
dependencyFactory: org.gradle.api.internal.artifacts.DefaultDependencyFactory@31440202
dependencyLocking: org.gradle.internal.locking.DefaultDependencyLockingHandler_Decorated@258c1ef
dependencyMetaDataProvider: org.gradle.internal.service.scopes.ProjectScopeServices$ProjectBackedModuleMetaDataProvider@37028898
depth: 0
description: null
detachedState: false
displayName: root project 'KotlinTest'
distsDirName: distributions
distsDirectory: extension 'base' property 'distsDirectory'
docsDir: D:\Development\Intellij\KotlinTest\build\docs
docsDirName: docs
ext: org.gradle.internal.extensibility.DefaultExtraPropertiesExtension@5dc834d2
extensions: org.gradle.internal.extensibility.DefaultConvention@4d2d783
fileOperations: org.gradle.api.internal.file.DefaultFileOperations@1c49d3d5
fileResolver: org.gradle.api.internal.file.BaseDirFileResolver@6b26b46
gradle: build 'KotlinTest'
gradleKotlinDsl.projectAccessorsClassPath: AccessorsClassPath(bin=[C:\Users\ranja\.gradle\caches\8.7\kotlin-dsl\accessors\9ddee7cd831440827748db4e5d8a5d9e\classes], src=[C:\Users\ranja\.gradle\caches\8.7\kotlin-dsl\accessors\9ddee7cd831440827748db4e5d8a5d9e\sources])
gradleKotlinDsl.stage1AccessorsClassPath: AccessorsClassPath(bin=[C:\Users\ranja\.gradle\caches\8.7\kotlin-dsl\accessors\f18a1db0df61def90395368fd9b57d75-PS\classes], src=[C:\Users\ranja\.gradle\caches\8.7\kotlin-dsl\accessors\f18a1db0df61def90395368fd9b57d75-PS\sources])
group: com.tanishranjan
identityPath: :
inheritedScope: org.gradle.internal.extensibility.ExtensibleDynamicObject$InheritedDynamicObject@17d5e9e2
internalStatus: property(java.lang.Object, fixed(class java.lang.String, integration))
java: extension 'java'
javaToolchains: extension 'javaToolchains'
kotlin: extension 'kotlin'
kotlin.code.style: official
kotlin.plugin.loaded.in.projects.1.9.23: :
kotlin.properties.provider: org.jetbrains.kotlin.gradle.plugin.PropertiesProvider@59a28cb4
kotlinScripting: extension 'kotlinScripting'
kotlinTestRegistry: org.jetbrains.kotlin.gradle.testing.internal.KotlinTestsRegistry@4c5f249d
layout: org.gradle.api.internal.file.DefaultProjectLayout@747d5e0d
libsDirName: libs
libsDirectory: extension 'base' property 'libsDirectory'
listenerBuildOperationDecorator: org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator@46e3adbd
logger: org.gradle.internal.logging.slf4j.OutputEventListenerBackedLogger@be94ef9
logging: org.gradle.internal.logging.services.DefaultLoggingManager@3ea7e8d5
model: root project 'KotlinTest'
modelIdentityDisplayName: null
modelRegistry: org.gradle.model.internal.registry.DefaultModelRegistry@20b4443a
name: KotlinTest
normalization: org.gradle.normalization.internal.DefaultInputNormalizationHandler_Decorated@7b618bd4
objects: org.gradle.api.internal.model.DefaultObjectFactory@3a3e9cc7
org.gradle.java.home: C:\Users\ranja\.jdks\openjdk-19.0.1
org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycle: Kotlin Plugin Lifecycle: (root project 'KotlinTest') stage 'ReadyForExecution' *finished successfully*
org.jetbrains.kotlin.whenEvaluated: [() -> kotlin.Unit, () -> kotlin.Unit]
owner: root project 'KotlinTest'
parent: null
parentIdentifier: null
path: :
pluginContext: false
pluginManager: org.gradle.api.internal.plugins.DefaultPluginManager_Decorated@79ec9f5d
plugins: [org.gradle.api.plugins.HelpTasksPlugin$Inject@42ed5f75, org.gradle.buildinit.plugins.BuildInitPlugin$Inject@63df0ab0, org.gradle.buildinit.plugins.WrapperPlugin$Inject@6d3464e5, org.gradle.language.base.plugins.LifecycleBasePlugin$Inject@1bd9bc8c, org.gradle.api.plugins.BasePlugin$Inject@3c8ce68e, org.gradle.api.plugins.JvmEcosystemPlugin$Inject@485fa699, org.gradle.api.plugins.ReportingBasePlugin$Inject@70e8ad70, org.gradle.api.plugins.JvmToolchainsPlugin$Inject@59885904, org.gradle.api.plugins.JavaBasePlugin$Inject@173ec33, org.gradle.testing.base.plugins.TestSuiteBasePlugin$Inject@4222a3fd, org.gradle.api.plugins.JvmTestSuitePlugin$Inject@81ccfd6, org.gradle.api.plugins.JavaPlugin$Inject@7437fe80, org.jetbrains.kotlin.gradle.scripting.internal.ScriptingKotlinGradleSubplugin@cd0d18d, org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin@4e5c5fd4, org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper@2f4c90a7, org.gradle.kotlin.dsl.provider.plugins.KotlinScriptRootPlugin$Inject@42dbbff3, org.gradle.kotlin.dsl.provider.plugins.KotlinScriptBasePlugin$Inject@64e1dfae]
processOperations: org.gradle.process.internal.DefaultExecActionFactory$DecoratingExecActionFactory@6762d08
project: root project 'KotlinTest'
projectConfigurator: org.gradle.api.internal.project.BuildOperationCrossProjectConfigurator@d9600cb
projectDir: D:\Development\Intellij\KotlinTest
projectEvaluationBroadcaster: ProjectEvaluationListener broadcast
projectEvaluator: org.gradle.configuration.project.LifecycleProjectEvaluator@6197c78a
projectPath: :
properties: {...}
providers: org.gradle.api.internal.provider.DefaultProviderFactory_Decorated@7c9caa92
reporting: extension 'reporting'
repositories: repository container
resources: org.gradle.api.internal.resources.DefaultResourceHandler@4b35d664
rootDir: D:\Development\Intellij\KotlinTest
rootProject: root project 'KotlinTest'
rootScript: false
script: false
scriptHandlerFactory: org.gradle.api.internal.initialization.DefaultScriptHandlerFactory@76180791
scriptPluginFactory: org.gradle.configuration.ScriptPluginFactorySelector@296c354f
serviceRegistryFactory: org.gradle.internal.service.scopes.BuildScopeServiceRegistryFactory@303dd2ca
services: Project services
sourceCompatibility: 19
sourceSets: SourceSet container
standardOutputCapture: org.gradle.internal.logging.services.DefaultLoggingManager@3ea7e8d5
state: project state 'EXECUTED'
status: integration
subprojects: []
systemProp.http.proxyHost:
systemProp.http.proxyPort: 80
systemProp.https.proxyHost:
systemProp.https.proxyPort: 80
targetCompatibility: 19
taskDependencyFactory: org.gradle.api.internal.tasks.DefaultTaskDependencyFactory@55dea45f
taskThatOwnsThisObject: null
tasks: task set
testReportDir: D:\Development\Intellij\KotlinTest\build\reports\tests
testReportDirName: tests
testResultsDir: D:\Development\Intellij\KotlinTest\build\test-results
testResultsDirName: test-results
testing: extension 'testing'
version: 1.0-SNAPSHOT
versionCatalogs: extension 'versionCatalogs'
BUILD SUCCESSFUL in 32s
1 actionable task: 1 executedTanish Ranjan
07/18/2024, 8:26 AMDirectory 'C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot' (Windows Registry) used for java installations does not existVampire
07/18/2024, 9:18 AMThe project contains aI don't know "what a sourceSet task would return". The task can do whatever you want. And I have no idea what the Android Gradle Plugin task of that name does, as I'm not into Android development.property of typesourceSet. Isn't that what a sourceSet task would return?SourceSet container
Also how could I get rid of the remaining registry files for the uninstalled version of java? It is really annoying for this message to pop up again and again:Clean your Windows registry. But be super carefull, if you do the wrong thing, you can harm your whole Windows installation. Here you find the Registry places Gradle checks: https://github.com/gradle/gradle/blob/master/platforms/jvm/jvm-services/src/main/j[…]/gradle/jvm/toolchain/internal/WindowsInstallationSupplier.java Alternatively install that JDK again and then properly uninstall it which should usually also clean that entry from the registry.