No, Java moss doesn’t need sunlight to grow. Durable and adaptable, this plant can grow under almost any lighting conditions.
Java moss can tolerate anything from strong lighting to no light at all, so you don’t need to worry about providing the plant with direct sunlight.
With that said, the more light Java moss gets, the faster it will grow. Therefore, if the tank is too dark, the plant’s growth rate might slow down or even stop entirely. On the other hand, you should limit the lighting to only 8–10 hours a day. Otherwise, your Java moss will grow very quickly and take over your tank.