I have anubias nana in my 5 gallon betta tank. They grow smaller than regular anubias. I even have some attached to the tall stemware wineglass using string where the beta likes to relax in. Anubias are slow growing large leafed plants that only need low lighting. I fertilize just a bit with seachem flourish comprehensive.
Hey! you will need to attach the java fern plant to a hard surface like driftwood or rock. You can use a rubber band, super glue, or thread to attach the plant to the driftwood. Here are some useful articles that can help: