15

I am having a problem running gradle on ubuntu 13.10, which I am assuming is the root of the issue.

I installed gradle using the below command

sudo apt-get install gradle

I am getting an error when running the command gradle -version:

gradle -version

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

I am using java version:

java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

I'm not sure what else to do. I tried different versions of java, but to no avail.

LSerni
  • 55,617
  • 10
  • 65
  • 107
user101010101
  • 1,609
  • 6
  • 31
  • 52

4 Answers4

11

I've come up with the patch to the Makefile for libnative-platform-jni.

sudo apt-get build-dep libnative-platform-java
apt-get source libnative-platform-java
cd libnative-platform-java-0.3~rc2/

Apply this patch:

--- Makefile.orig   2013-11-20 10:42:54.599476939 -0800
+++ Makefile    2013-11-20 10:43:04.879476606 -0800
@@ -28,7 +28,7 @@
  $(CXX) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -o $@ $^

 $(ODIR)/libnative-platform-curses.so: $(OBJ_CURSES)
-   $(CXX) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -lcurses -shared -o $@ $^
+   $(CXX) $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -o $@ $^ -lcurses

 $(JCLASSESDIR)/%.class: javafiles-list
  mkdir -p $(JCLASSESDIR)

Run:

dpkg-source --commit
dpkg-buildpackage
cd ..
sudo dpkg -i libnative-platform-jni_0.3~rc2-2_amd64.deb

Test with

gradle -v

See my comment here: https://bugs.launchpad.net/ubuntu/+source/gradle/+bug/1238322/comments/4

Update: You may want to checkout the ppa here https://launchpad.net/~cwchien/+archive/gradle since gradle 1.4 is pretty old.

Eric Woodruff
  • 6,380
  • 3
  • 36
  • 33
3

I had the same issue with Ubuntu 13.10. Since 14.04 has been released now, you might consider upgrading: Gradle works perfectly on Ubuntu 14.04. However, I'd recommend downloading gradle from the gradle website since the official repos still only have gradle 1.4

LeBird
  • 728
  • 5
  • 17
  • 1
    I am on Ubuntu 14.04 and [this bug keeps happening](http://stackoverflow.com/questions/22307516/gradle-finds-wrong-java-home-even-though-its-correctly-set). – Water Apr 18 '15 at 16:52
3

/home/stens/src/jvm/java-1.8.0-openjdk-amd64/bin/java: symbol lookup error: /usr/lib/jni/libnative-platform-curses.so: undefined symbol: tgetent

This is the easiest workaround I've found ... download the deb here

https://packages.debian.org/sid/amd64/libnative-platform-jni/download

then install using

sudo dpkg -i libnative-platform-jni_0.11-5_amd64.deb 

now gradle works ... Ubuntu 17.10

Scott Stensland
  • 26,870
  • 12
  • 93
  • 104
  • This broke my Gradle installation (at least). Perhaps it would be a good to know which libnative-platform-jni version to download. – xarlymg89 Mar 01 '18 at 13:14
1

I was able to fix the above problem with advice from Vidya, manually adding gradle into the system allow gradle to correctly work.

user101010101
  • 1,609
  • 6
  • 31
  • 52