Right now I am using:
echo -ne '\n' | alternatives --config java
For
Enter to keep the current selection, or type selection number:
I know there are probably many ways to do this. I am looking for the correct way to perform this action. I honestly don't even know if I'm doing it right.
Probably you could use something less interactive.
should work. Or you can use 'expect' command to emulate user input.