Maven projects created with J2SE-1.5 [message #1855629] |
Mon, 24 October 2022 15:58 |
Phil Buxton Messages: 1 Registered: October 2022 |
Junior Member |
|
|
Please help me with a problem that is driving me up the wall. I have been scouring the internet for a solution for a couple of weeks and I can only find ways of correcting the problem after it has happened, not stopping it from happening in the first place.
OS: Windows 10
Java version: 19.0.1
Eclipse version: 2022-09
I have been using Eclipse for a few years and have upgraded a few times and upgraded my version of the JDK a few times too. I am a fairly novice programmer so I'll need some very specific instructions in plain English or a may not understand what I am being advised to do.
The default JRE selected in Eclipse under Installed JREs is jdk-19.
When I create a Maven project (I don't use archetypes), my project ends up with a folder called JRE System Library [J2SE-1.5], which is obviously the runtime environment the project will use.
Why aren't my Maven projects using my default JRE?
I have a couple of solutions to correct this, but I have to do it with every project. Firstly, I can add a dependency to the project's POM file. Secondly (see screenshots), I can go into the Properties of the project -> Java Build Path -> Libraries tab, where I select the 1.5 version and remove it, then add the JRE system library. Both of these fix it after the project's creation.
How do I get it to give me the right one in the first place? It seems that what I want to do is make the correction shown in the images at system level but I only know how to do it at project level, but I can't find a way of doing that.
I did find an article (which I'm not allowed to post a link to here) suggesting a solution but it mentions a .m2 file, but that doesn't exist on my computer as far as I can see.
Can anybody help? It's really bugging me.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02302 seconds