Is there a difference in how AdoptOpenJDK and AzulOpenJDK handle new File("version")?

297 views Asked by At

I have the below in my build.gradle file

static def getVersionName() {
    return new File("version").getText().trim()
}

When I use AdoptOpenJDK, it compiles well. However, when I use AzulOpenJDK, it complains:

* What went wrong:
A problem occurred evaluating project ':app'.
> version (No such file or directory)

Is there a difference in how AdoptOpenJDK and AzulOpenJDK handle the above command?

1

There are 1 answers

0
Elye On

Making it

def getVersionName() {
    return new File(rootProject.rootDir, "version").getText().trim()
}

now works for both. Thanks @Clashsoft