Skip to content

[Native Image] Error > 'other' has different root when buildingย #11795

@duykhongphai

Description

@duykhongphai

Describe the Issue

Iโ€™m not sure why this happens, but I installed GraalVM JDK on the C drive and set both JAVA_HOME and GRAALVM_HOME to the full installation path. I also verified that the native-image tool is available on all drives. However, the issue is that I can only build native images on the C drive. When I try to build on a different drive (like D or E), I get the following error:
*** What went wrong:
Execution failed for task ':nativeCompile'.

'other' has different root**

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

0.11.0

Operating System and Version

Windows

Build Command

plugins {
id 'java'
id 'org.graalvm.buildtools.native' version '0.11.0'

}

group = 'org.test'
version = '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}

test {
useJUnitPlatform()
}
graalvmNative {
binaries {
main {
imageName = 'application'
mainClass = 'org.test.Main'
debug = true
verbose = true
fallback = true
sharedLibrary = false
quickBuild = false
richOutput = false
}
}
}

Expected Behavior

Output as .exe

Actual Behavior

No output was generated

Steps to Reproduce

  1. Install GraalVM.
  2. Create a new Gradle project using Groovy.
  3. Use the build.gradle file I provided above.
  4. Run the nativeCompile task to build the native executable.

Additional Context

No response

Build Log Output and Error Messages

Image

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions