[SOLVED] gradle: java: symbol lookup error libnative-platform-curses.so: undefined symbol: tgetent

This is a solution for an exception occurred when you try to run any gradle task using improper JDK.

Problem

When you try execute any gradle task (i.e.. gradle tasks) an exception is thrown like below :

 

java: symbol lookup error: /usr/lib/jni/libnative-platform-curses.so: undefined symbol: tgetent

Cause

You try to use openjdk instead of oracle-jdk. Probably because oenjdk is set as default JDK in your OS.  You can verify this by typing:

java -version

In my case I got:

openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.17.10.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

Solution

Set proper JAVA_HOME environment variable and retry gradle task.

Linux:

export JAVA_HOME=/home/better-coding/tools/jdk1.8.0_101/
gradle tasks

Windows:

set JAVA_HOME=d:\tools\jdk1.8.0_101
gradle tasks

 

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu