Based on what you describe, you have the most updated version of R installed and RStudio is able to detect it. However the version of R that is currently in your OS environment variable (and hence used by Java) is not the most recent,
=> you need to update your PATH environment variable. The procedure might be a bit different whether you are on Unix or Windows.
I am sure you'll find plenty of ressources on Internet to help you do that How to update PATH variable permanently from cmd? Windows