In the Buddha's time laypeople too could attain jhāna, if they would lead a life which was compatible with its development, One should lead a secluded life and many conditions have to be fulfilled. Jhāna is quite incompatible with sense-desires. One has to be 'quite secluded from sense-desires...' in order to attain the first jhāna, as we read in many suttas.
The 'Visuddhimagga' (IV, 81) explains:
'When absoluteness is introduced thus 'quite secluded from sense desires',
what is expressed is this: sense desires are certainly incompatible with this
jhāna: when they exist, it does not occur, just as when there is darkness,
there is no lamplight; and it is only by letting go of them that it is reached
just as the further bank is reached by letting go of the near bank. That is
why absoluteness is introduced.'
Thus we see that the development of jhāna is not for everyone. Jhāna cannot
be attained if one leads a 'worldly life', full of sense-pleasures, instead of a life
of 'fewness of wishes, seclusion, modest needs'.
The 'Visuddhimagga' (III, 129) also states that one should sever any
impediments to the development of samatha. Among them are one's dwelling,
travelling and sickness. These can be hindrances to samatha. One should
avoid living in a monastery which, for various reasons, is unfavourable to the
development of samatha. Thus, even before one starts to develop samatha,
many conditions have to be fulfilled.