We estimated the spectral evolution of white dwarfs with effective temperature using the Javalambre Photometric Local Universe Survey (J-PLUS) second data release (DR2), which provides 12 photometric optical passbands over 2176deg^2^. We analyzed 5926 white dwarfs with r<19.5mag in common between a white dwarf catalog defined from Gaia EDR3 and J-PLUS DR2. We performed a Bayesian analysis by comparing the observed J-PLUS photometry with theoretical models of hydrogen- and helium-dominated atmospheres. We estimated the probability distribution functions for effective temperature (Teff), surface gravity, parallax, and composition; and the probability of having a H-dominated atmosphere (p_H_) for each source. We applied a prior in parallax, using Gaia EDR3 measurements as a reference, and derived a self-consistent prior for the atmospheric composition as a function of Teff. We described the fraction of white dwarfs with a He-dominated atmosphere (f_He_) with a linear function of the effective temperature at 5000<Teff<30000K. We find f_He_=0.24+/-0.01 at Teff=10000K, a change rate along the cooling sequence of 0.14+/-0.02 per 10kK, and a minimum He-dominated fraction of 0.08+/-0.02 at the high-temperature end. We tested the obtained p_H_ by comparison with spectroscopic classifications, finding that it is reliable. We estimated the mass distribution for the 351 sources with distance d<100pc, mass M>0.45M_{sun}_, and Teff>6000K. The result for H-dominated white dwarfs agrees with previous studies, with a dominant M=0.59M_{sun}_ peak and the presence of an excess at M~0.8M_{sun}_. This high-mass excess is absent in the He-dominated distribution, which presents a single peak. The J-PLUS optical data provide a reliable statistical classification of white dwarfs into H- and He-dominated atmospheres. We find a 21+/-3% increase in the fraction of He-dominated white dwarfs from Teff=20000K to Teff=5000K.