Skip to content
DavidASeibert edited this page Nov 27, 2018 · 9 revisions

Welcome to the nfs-client-java wiki! If you're looking for a pure Java NFS client, or want to contribute to one, you're at the right place. This is a pure Java version, with no native code, so all NFS operations are handled through RPC calls, and the file system does not need to be mounted anywhere. If all you want is the executable, it's published in maven central, you can find the latest version at The Central Repository Search Engine.

The initial version supports NFSv3 (RFC 1813), but we plan to extend this to support other NFS versions as needed. We use it in ecs-sync, but you're welcome to use it anywhere else you might want. It's licensed under Apache Version 2.0.

Handling secure NFS servers that require a privileged client port (below 1024)

The nfs client library will handle secure mounts automatically, but that is possible only if the client is run as root. In this case, the client will detect that the server requires a privileged client port (one below 1024), and will automatically find and use one if that is possible. If the client is not running as root, though, the operating system will not let the client use a privileged port, and so it will fail to mount the secure NFS server.

To do this, the user running the application on the client machine that calls the nfs client must have root privileges. If that user has root privileges, the client machine will let the NFS client use a privileged port on the client machine. If that user does not have root privileges, the client will be unable to use a privileged port on the client machine, and the mount will fail. To test, you can try running a command as that user, to mount the secure NFS server files on the client machine. If that user cannot use a privileged port, then that mount command will also fail.

How to import into eclipse and IDEA

To import the code into eclipse or IDEA, you will need to create a gradle.properties file in the folder ~/.gradle, and make sure it defines the following values.

# path to Java 6 jre/lib (if installed)
#java6Lib=
java7Lib=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/jre/lib
# set these if you plan on publishing. note: you will be prompted for passwords if necessary
sonatypeUsername=
githubUsername=
gitUsername=
# Located on the signing server. KeyId can be found using gpg --list-keys
signingKeyId=
signingSecretKeyRingFile=