Setting jdk while project creation

I want to be able to select a jdk during project creation like how it asks for java project creation. I tried using DefaultModuleEditorsProvider for
<moduleConfigurationEditorProvider implementation="com.intellij.openapi.roots.ui.configuration.DefaultModuleEditorsProvider"/>
but that didn't seem to work. Am I missing out something?

Thanks



Attachment(s):
java jdk selection.png
custom jdk selection.png
2 comments
Comment actions Permalink

You can extend com.intellij.ide.util.projectWizard.ModuleBuilder and override following method like this:

    @Nullable     @Override     public ModuleWizardStep modifySettingsStep(@NotNull SettingsStep settingsStep) {         return ProjectWizardStepFactory.getInstance().createJavaSettingsStep(settingsStep, this, new Condition<SdkTypeId>() {             @Override             public boolean value(SdkTypeId sdkType) {                 return isSuitableSdkType(sdkType);             }         });     }

This adds SDK selection to Your module configuration steps.
See also com.intellij.openapi.module.ModuleType class.

0
Comment actions Permalink

Thanks Marcin, it works

0

Please sign in to leave a comment.