diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 40cd165af..60b905066 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -21,6 +21,8 @@ Release with new features and bugfixes: * https://github.com/devonfw/IDEasy/issues/440[#440]: Generalize intellij OS startup command for all OS's * https://github.com/devonfw/IDEasy/issues/612[#612]: Automatically generated issue URL is still pointing to ide instead of IDEasy * https://github.com/devonfw/IDEasy/issues/52[#52]: Adjusting Intellij settings in ide-settings +* https://github.com/devonfw/IDEasy/issues/588[#588]: ide create installs wrong Java version + The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/13?closed=1[milestone 2024.09.002]. == 2024.09.001 diff --git a/cli/src/main/java/com/devonfw/tools/ide/commandlet/AbstractUpdateCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/commandlet/AbstractUpdateCommandlet.java index 83cbeebe2..5ef4c04e6 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/commandlet/AbstractUpdateCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/commandlet/AbstractUpdateCommandlet.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Set; +import com.devonfw.tools.ide.context.AbstractIdeContext; import com.devonfw.tools.ide.context.GitContext; import com.devonfw.tools.ide.context.IdeContext; import com.devonfw.tools.ide.property.FlagProperty; @@ -45,6 +46,7 @@ public void run() { updateSettings(); updateConf(); + reloadContext(); if (this.skipTools.isTrue()) { this.context.info("Skipping installation/update of tools as specified by the user."); @@ -53,6 +55,11 @@ public void run() { } } + private void reloadContext() { + + ((AbstractIdeContext) this.context).reload(); + } + private void updateConf() { Path templatesFolder = this.context.getSettingsPath().resolve(IdeContext.FOLDER_TEMPLATES); diff --git a/cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java b/cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java index b1e3b1450..e8ccdc4d7 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java +++ b/cli/src/main/java/com/devonfw/tools/ide/context/AbstractIdeContext.java @@ -92,7 +92,7 @@ public abstract class AbstractIdeContext implements IdeContext { private Path downloadPath; - private Path toolRepository; + private Path toolRepositoryPath; private Path userHome; @@ -169,14 +169,14 @@ public AbstractIdeContext(IdeStartContextImpl startContext, Path userDir, ToolRe setCwd(userDir, workspace, currentDir); if (this.ideRoot == null) { - this.toolRepository = null; + this.toolRepositoryPath = null; this.urlsPath = null; this.tempPath = null; this.tempDownloadPath = null; this.softwareRepositoryPath = null; } else { Path ideBase = this.ideRoot.resolve(FOLDER_IDE); - this.toolRepository = ideBase.resolve("software"); + this.toolRepositoryPath = ideBase.resolve("software"); this.urlsPath = ideBase.resolve("urls"); this.tempPath = ideBase.resolve("tmp"); this.tempDownloadPath = this.tempPath.resolve(FOLDER_DOWNLOADS); @@ -490,7 +490,7 @@ public Path getUrlsPath() { @Override public Path getToolRepositoryPath() { - return this.toolRepository; + return this.toolRepositoryPath; } @Override @@ -1051,4 +1051,11 @@ public IdeStartContextImpl getStartContext() { return startContext; } + + /** + * Reloads this context and re-initializes the {@link #getVariables() variables}. + */ + public void reload() { + this.variables = createVariables(); + } }