Java moss is NOT an algae - I think you're thinking Marimo balls which are a type of Cladophora algae (fun when it grows in a ball, hell if it's growing any other way). Java moss, and most of the other semi-aquatic mosses, are true mosses. Two other "moss look alikes" you come across may be liverworts (Riccia and Pellia respectively) and Subwassertang (looks like a liverwort but is actually a mutated fern gametophyte that never matures).
With the exception of a few truly aquatic mosses, most of the above will eventually grow out of the water onto wet land if given the chance. The liverworts and Subwassertang may be a little more needy about light (it may die in lower light, the mosses just grow veeeeeeery slooooowly) and less forgiving about drying out, but otherwise have been used interchangeably with the mosses both above and below the water line.