I believe scripture teaches that the sun would endure through all generations (Psalm 72:5) which means it will endure until the end of the age but at that point it will cease to exist. I don't believe "forever" includes all eternity in those verses but instead refers to all of time up until the end of time or end of the age. That doesn't mean His name won't endure even throughout eternity but that wasn't the context of those verses as far as the sun is concerned. It's similar to how Jesus told the disciples that He would be with them always even until the end of the age (Matt 28:20). Well, He will be with them even after the end of the age but that wasn't His point there. So "always" doesn't include eternity in that context but includes all of time until the end of the age. That's how I understand the duration of the sun as well. There will be no need for the sun on the new earth, IMO, because the glory of God and Christ Himself will provide all the light we need.