They are both measures of energy and can be converted to each other using this conversion:
J/kg = Nm/kg = kg m sec^-2 m kg^-1 = m^2/sec^2