Native-platform is not available

Hello, I’m new to gradle. If I start gradle I get the following Error on my linux-system:

gradle -debug 23:15:13.949 [DEBUG] [org.gradle.internal.nativeplatform.services.NativeServices] Native-platform is not available. 23:15:14.015 [ERROR] [org.gradle.BuildExceptionReporter]

23:15:14.016 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 23:15:14.016 [ERROR] [org.gradle.BuildExceptionReporter]

23:15:14.017 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 23:15:14.017 [ERROR] [org.gradle.BuildExceptionReporter] java.lang.NoSuchFieldException: fd 23:15:14.026 [ERROR] [org.gradle.BuildExceptionReporter]

23:15:14.027 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is: 23:15:14.027 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.internal.UncheckedException: java.lang.NoSuchFieldException: fd 23:15:14.028 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:39) 23:15:14.028 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.internal.nativeplatform.jna.LibCBackedConsoleDetector.checkIsConsole(LibCBackedConsoleDetector.java:58) 23:15:14.029 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.internal.nativeplatform.jna.LibCBackedConsoleDetector.getConsole(LibCBackedConsoleDetector.java:35) 23:15:14.029 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.logging.internal.ConsoleConfigureAction.execute(ConsoleConfigureAction.java:32) 23:15:14.030 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.logging.internal.ConsoleConfigureAction.execute(ConsoleConfigureAction.java:27) 23:15:14.030 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.logging.internal.OutputEventRenderer.attachConsole(OutputEventRenderer.java:68) 23:15:14.031 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.logging.internal.DefaultLoggingManager.attachConsole(DefaultLoggingManager.java:146) 23:15:14.032 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:168) 23:15:14.032 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) 23:15:14.033 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 23:15:14.033 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 23:15:14.034 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.Main.doAction(Main.java:46) 23:15:14.034 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 23:15:14.035 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.Main.main(Main.java:37) 23:15:14.035 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) 23:15:14.036 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) 23:15:14.062 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 23:15:14.063 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoSuchFieldException: fd 23:15:14.064 [ERROR] [org.gradle.BuildExceptionReporter]

at org.gradle.internal.nativeplatform.jna.LibCBackedConsoleDetector.checkIsConsole(LibCBackedConsoleDetector.java:54) 23:15:14.065 [ERROR] [org.gradle.BuildExceptionReporter]

…15 more 23:15:14.065 [ERROR] [org.gradle.BuildExceptionReporter]

Can anyone help.

By the way. Its Gradle 1.11.

Which exact OS are you using?

Hello, openSUSE 13.1, Kernel 3.11

Raised GRADLE-3056. Thanks for the report.

Which jvm are you using? Can you provide the output of ‘gradle -v’?

Hello, sorry for my late reply. I was in holiday.

My Java-Version: java version “1.8.0” Java™ SE Runtime Environment (build 1.8.0-b132) Java HotSpot™ 64-Bit Server VM (build 25.0-b70, mixed mode)

My output from gradle -v:

FAILURE: Build failed with an exception.

  • What went wrong: java.lang.NoSuchFieldException: fd

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

But the problem exists also with: java version “1.7.0_51” Java™ SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot™ 64-Bit Server VM (build 24.51-b03, mixed mode)

Would you mind downloading and running the test app for our native integration from here: http://repo.gradle.org/gradle/libs-releases-local/net/rubygrapefruit/native-platform-test/0.10/native-platform-test-0.10.zip

Ideally, when you run this you should get some coloured text and some information about your system.

Hello, I get the following output:

./native-platform-test

  • JVM: Free Software Foundation, Inc. 1.5.0 * OS (JVM): Linux 3.11.10-7-desktop x86_64 Exception in thread “main” net.rubygrapefruit.platform.NativeIntegrationUnavailableException: Native integration is not available for Linux x86_64.

at net.rubygrapefruit.platform.internal.Platform.getLibraryName(Platform.java:84)

at net.rubygrapefruit.platform.Native.init(Native.java:55)

at net.rubygrapefruit.platform.Native.get(Native.java:80)

at net.rubygrapefruit.platform.test.Main.main(Main.java:51)

I’m very sorry. It was my mistake. My distribution has overwritten my JAVA_HOME variable with incorrect settings. I have not seen till now. Now it runs. Thanks for your help.

gradle -v

------------------------------------------------------------ Gradle 1.11 ------------------------------------------------------------

Build time:

2014-02-11 11:34:39 UTC Build number: none Revision:

a831fa866d46cbee94e61a09af15f9dd95987421

Groovy:

1.8.6 Ant:

Apache Ant™ version 1.9.2 compiled on July 8 2013 Ivy:

2.2.0 JVM:

1.8.0 (Oracle Corporation 25.0-b70) OS:

Linux 3.11.10-7-desktop amd64

./native-platform-test

  • JVM: Oracle Corporation 1.8.0 * OS (JVM): Linux 3.11.10-7-desktop amd64 * OS (Kernel): Linux 3.11.10-7-desktop x86_64 (amd64) * PID: 10316 * File systems:

  • / -> rootfs (rootfs local)

  • /dev -> devtmpfs (devtmpfs local)

  • /dev/shm -> tmpfs (tmpfs local)

  • /run -> tmpfs (tmpfs local)

  • /dev/pts -> devpts (devpts local)

  • / -> /dev/sda2 (ext4 local)

  • /proc -> proc (proc local)

  • /sys -> sysfs (sysfs local)

  • /sys/kernel/security -> securityfs (securityfs local)

  • /sys/fs/cgroup -> tmpfs (tmpfs local)

  • /sys/fs/cgroup/systemd -> cgroup (cgroup local)

  • /sys/fs/pstore -> pstore (pstore local)

  • /sys/fs/cgroup/cpuset -> cgroup (cgroup local)

  • /sys/fs/cgroup/cpu,cpuacct -> cgroup (cgroup local)

  • /sys/fs/cgroup/memory -> cgroup (cgroup local)

  • /sys/fs/cgroup/devices -> cgroup (cgroup local)

  • /sys/fs/cgroup/freezer -> cgroup (cgroup local)

  • /sys/fs/cgroup/net_cls -> cgroup (cgroup local)

  • /sys/fs/cgroup/blkio -> cgroup (cgroup local)

  • /sys/fs/cgroup/perf_event -> cgroup (cgroup local)

  • /sys/fs/cgroup/hugetlb -> cgroup (cgroup local)

  • /proc/sys/fs/binfmt_misc -> systemd-1 (autofs local)

  • /dev/mqueue -> mqueue (mqueue local)

  • /dev/hugepages -> hugetlbfs (hugetlbfs local)

  • /proc/sys/fs/binfmt_misc -> binfmt_misc (binfmt_misc local)

  • /sys/kernel/debug -> debugfs (debugfs local)

  • /var/lock -> tmpfs (tmpfs local)

  • /var/run -> tmpfs (tmpfs local)

  • /datadrive -> /dev/sdb1 (ext4 local)

  • /sys/fs/fuse/connections -> fusectl (fusectl local)

  • /var/run/vmblock-fuse -> vmware-vmblock (fuse.vmware-vmblock local)

  • /run/vmblock-fuse -> vmware-vmblock (fuse.vmware-vmblock local)

  • /run/user/1000/gvfs -> gvfsd-fuse (fuse.gvfsd-fuse local)

  • /var/run/user/1000/gvfs -> gvfsd-fuse (fuse.gvfsd-fuse local) * Stdout: terminal * Stderr: terminal * Terminal implementation: Curses terminal on stdout * Terminal size: 132 cols x 36 rows * Text attributes: yes * Color: yes * Cursor motion: yes

TEXT ATTRIBUTES [normal] [bold] [normal]

COLORS [black] [black] [red] [red] [green] [green] [yellow] [yellow] [blue] [blue] [magenta] [magenta] [cyan] [cyan] [white] [white]

CURSOR MOVEMENT [1]

[2]

[3]

[4]

done!

Do you know what that old jdk was, that your JAVA_HOME was pointing at and the test app was broken for? It’s some kind of java 1.5 jvm by the looks of it.

Yes, it was 1.5 from gcc.

./java -version java version “1.5.0” gij (GNU libgcj) version 4.8.1 20130909 [gcc-4_8-branch revision 202388]

Copyright © 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The package manager has this old version automatically installed with another program. The PATH variable was pointed to the Oracle Java and the JAVA_HOME variable to the gcj