  M 39 is a nearby young open cluster hardly studied in the last decades. No
giant is known among its members and its chemical composition has never been
studied. In order to investigate it we performed high-resolution spectroscopy
of 20 expected cluster members with the HARPS and FIES spectrographs. By
combining our observations with archival photometry and $Gaia$-DR3 data we
searched for evolved members and studied cluster properties such as the radial
velocity, extinction and age. For the first time, we provide stellar parameters
and chemical abundances for 21 species with atomic numbers up to 56. We have
not found any new giant as likely member and notice a negligible reddening
along the cluster field, that we place at 300 pc. We obtain a mean radial
velocity for M 39 of -5.5$\pm$0.5 km s$^{-1}$ and an isochrone-fitting age of
430$\pm$110 Ma, which corresponds to a MSTO mass of around 2.8 Msol. This value
is consistent with the Li content and chromospheric activity shown by its
members. Based on main-sequence stars the cluster exhibits a solar composition,
[Fe/H]=+0.04$\pm$0.08 dex, compatible with its Galactocentric location.
However, it has a slightly subsolar abundance of Na and an enriched content of
neutron-capture elements, specially Ba. In any case, the chemical composition
of M 39 is fully compatible with that shown by other open clusters that
populate the Galactic thin disc
