Context. The formation mechanisms of stellar, brown dwarf, and planetary companions, their dependencies on the environment and their interactions with each other are still not well established. Recently, combining high-contrast imaging and space astrometry we found that Jupiter-like (JL) planets are frequent in the β Pic moving group (BPMG) around those stars where their orbit can be stable, prompting further analysis and discussion. Aims. We broaden our previous analysis to other young nearby associations to determine the frequency, mass and separation of companions in general and JL in particular and their dependencies on the mass and age of the associations. Methods. We collected available data about companions to the stars in the BPMG and seven additional young associations, including those revealed by visual observations, eclipses, spectroscopy and astrometry. Results. We determined search completeness and found that it is very high for stellar companions, while completeness corrections are still large for JL companions. Once these corrections are included, we found a high frequency of companions, both stellar (>0.52 ± 0.03) and JL (0.57 ± 0.11). The two populations are clearly separated by a gap that corresponds to the well-known brown dwarf desert. Within the population of massive companions, we found clear trends in frequency, separation, and mass ratios with stellar mass. Planetary companions pile up in the region just outside the ice line and we found them to be frequent once completeness was considered. The frequency of JL planets decreases with the overall mass and possibly the age of the association. Conclusions. We tentatively identify the two populations as due to disk fragmentation and core accretion, respectively. The distributions of stellar companions with a semi-major axis <1000 au is indeed well reproduced by a simple model of formation by disk fragmentation. The observed trends with stellar mass can be explained by a shorter but much more intense phase of accretion onto the disk of massive stars and by a more steady and prolonged accretion on solar-type stars. Possible explanations for the trends in the population of JL planets with association mass and age are briefly discussed.