In June it sometimes can be as warm as 30 C everywhere along the coast. However, the average temperature is a bit over 20 C.
However, mornings are still very pleasant, with average temperatures around 15 C. During the day, it gets to about 25.
Several days of rain and unpleasant wind called jugo (jug means south in Croatina) can ocurr, so it is a good idea to check the weather conditions a weak ahead. If there is cyclone heading from the western Mediterranean over Italy to the east, it may rain. But otherwise, June is maybe the best time to visit Croatia.
Have a nice stay in Dubrovnik!