Rational sharing of unlicensed spectrum and efficient use of device-to-device (D2D) communication are two effective ways to improve energy efficiency (EE) and spectrum efficiency (SE) in 5G new radio system. In this paper, we extend the D2D technology to unlicensed spectrum and study the EE of user terminals in unlicensed D2D (D2D-U) system. To cope with the inherent distributed structure of the D2D-U enabled networks and the time-varying wireless fading channels, a distributed adaptive joint power and spectrum allocation scheme is proposed based on the differentiated projection method to maximize the EE of user terminals. The theoretic analysis and numerical results are provided to validate the performance of the proposed scheme, which not only significantly reduces the signaling overhead, but also achieves the global optimality as the centralized scheme.