The recent past witnesses the growing interdependence between the physics of hadrons, the physics of relativistic heavy-ion collisions, and the physics of compact objects in astrophysics. A notable example is the kaon which plays special roles in all the three fields. In this paper, we first review the various theoretical investigations of kaon properties in nuclear medium, focusing on possible uncertainties in each model. We then present a detailed transport model study of kaon production in heavy-ion collisions at SIS energies. We shall discuss especially the elementary kaon and antikaon production cross sections in hadron-hadron interactions, that represent one of the most serious uncertainties in the transport model study of particle production in heavy-ion collisions. The main purpose of such a study is to constrain kaon in-medium properties from the heavy-ion data. This can provide useful guidances for the development of theoretical models of the kaon in medium. In the last part of the paper, we apply the kaon in-medium properties extracted from heavy-ion data to the study of neutron star properties. Based on a conventional equation of state of nuclear matter that can be considered as one of the best constrained by available experimental data on finite nuclei, we find that the maximum mass of neutron stars is about 2M⊙, which is reduced to about 1.5M⊙ once kaon condensation as constrained by heavy-ion data is introduced.pacs: 25.75. Dw, 97.60.Jd, 26.60.+c, 24.10.Lx