charen
charen

Reputation: 371

JAVA_HOME is set to an invalid directory

I'm working with gradle and trying to deploy my JAVAFX application into .apk

If i run my gradle command it says that my JAVA_HOME is set to an invalid directory.

It is set to C:\Program Files\Java\javaversion\bin (there is an actual version actually, but it isn't necessery atm) And the same is at the environment variable.

Any ideas, why i'm getting this error?

Upvotes: 2

Views: 5713

Answers (3)

user3103059
user3103059

Reputation:

@charen You are right. Gradle, as of its last version 3.4.1, only works with Java 32 bits. So your JAVA_HOME shoud point to the Java JRE at Program Files (x86).

Upvotes: 1

Akash Thakare
Akash Thakare

Reputation: 22972

What is JAVA_HOME?

Its an Environment variable that helps to locate JDK and JRE.

As you are setting it to.

C:\Program Files\Java\javaversion\bin 

JAVA_HOME Should be set to root directory not upto bin

C:\Program Files\Java\javaversion

And in path variable put

C:\Program Files\Java\javaversion\bin OR %JAVA_HOME%\bin

You can read more about from This Link.

Upvotes: 8

Andrew McGuinness
Andrew McGuinness

Reputation: 2147

JAVA_HOME should be pointing one directory up, not at the bin directory

instead of

C:\Program Files\Java\javaversion\bin

use

C:\Program Files\Java\javaversion

Upvotes: 4

Related Questions