A method of self-consistent fields is used to study the equilibrium configurations of a system of self-gravitating scalar bosons or spin- 1/2 fermions in the ground state without using the traditional perfect-fluid approximation or equation of state. The many-particle system is described by a second-quantized free field, which in the boson case satisfies the Klein-Gordon equation in general relativity, ∇α∇αφ=μ2φ, and in the fermion case the Dirac equation in general relativity γα∇αψ=μψ (where μ=mcℏ). The coefficients of the metric gαβ are determined by the Einstein equations with a source term given by the mean value <φ|Tμν|φ> of the energy-momentum tensor operator constructed from the scalar or the spinor field. The state vector <φ| corresponds to the ground state of the system of many particles. In both cases, for completeness, a nonrelativistic Newtonian approximation is developed, and the corrections due to special and general relativity explicitly are pointed out. For N bosons, both in the region of validity of the Newtonian treatment (density from 10-80 to 1054 g cm-3, and number of particles from 10 to 1040) as well as in the relativistic region (density ~1054 g cm-3, number of particles ~1040), we obtain results completely different from those of a traditional fluid analysis. The energy-momentum tensor is anisotropic. A critical mass is found for a system of N~[(Planck mass)m]2~1040 (for m~10-25 g) self-gravitating bosons in the ground state, above which mass gravitational collapse occurs. For N fermions, the binding energy of typical particles is G2m5N43ℏ-2 and reaches a value ~mc2 for N~Ncrit~[(Planck mass)m]3~1057 (for m~10-24 g, implying mass ~1033 g, radius ~106 cm, density ~1015 g/cm3). For densities of this order of magnitude and greater, we have given the full self-consistent relativistic treatment. It shows that the concept of an equation of state makes sense only up to 1042 g/cm3, and it confirms the Oppenheimer-Volkoff treatment in extremely good approximation. There exists a gravitational spin-orbit coupling, but its magnitude is generally negligible. The problem of an elementary scalar particle held together only by its gravitational field is meaningless in this context.