In case you are having problems getting things to work, I implemented reconstructing position from depth as a LWJGL 3 demo, so you can have a look at it:
Java source: Java source
Depth-only shader: Vertex Shader and Fragment Shader
Fullscreen shader: Vertex Shader and Fragment Shader
I do not use a color drawbuffer to render the depth values to, but instead use a GL_DEPTH_COMPONENT texture as depth buffer attachment when rendering to the FBO. This way we slightly save bandwidth, since depth needs to be written anyways.
If you might have issues with the matrix inversion, this is implemented in Matrix4f.invert(). The demo uses a Camera implementation that does the computation of the view and projection matrices as well as the inverse of them based on GLU-like lookat and perspective methods.
You can use them.