Setting up an SDK and Language Version for new Project

I've asked a question here and it didn't draw much in terms of attention. I'm trying to make sure that a newly created project has a Java 8 SDK and language level and so far it gets configured with no SDK and doesn't show the SDK picker combo at the start.

I even tried to do this manually when finishing the project creation as such:

Sdk[] s = ProjectJdkTable.getInstance().getAllJdks();
boolean found = false;
for (Sdk ss : s) {
if (ss.getSdkType() instanceof JavaSdkType) {
String str = ss.getVersionString();
if (str.contains("1.8.") || str.contains("1.9.")) {

found = true;
if (!found) {

But that didn't work out very well and the newly created project still doesn't have an SDK configured.

BTW is there no JavaDoc for the API? I know I can generate it from the sources, it's just really surprising that I can't find it?

I'm nearing completion of the plugin rewrite and this is pretty much the only major problem I have left. To clarify, this is what I'm seeing after the project is created despite calling setSdk with the right SDK and setting the language level:


This is a HUGE problem as compilation using ant fails without setting both of those in a menu. So a newly created project doesn't compile which is rather unintuitive.

Any guidelines/help would be appreciated.



Hello Shai,

Did you check 

Project Settings  > Platform Settings > SDKs


is SDK configured there?

did you put a breakpoint right after 

Sdk[] s 

and check if the array is empty?



Yes I placed a breakpoint and it is reached. It finds the right JDK and sets it but the result is still the same.

There is a Java 8 SDK configured, although ideally I'd like the plugin to look like other plugins (e.g. the gradle plugin) where the SDK list appears in the UI that shows before the first step of the wizard. I'm not sure where that is configured?


Thanks! This helped a lot in setting the JDK, it seems I needed to invoke


Any idea how to add this to the wizard as a step?

My wizard derives from JavaModuleBuilder is that the reason it isn't showing in the first step?


> is that the reason it isn't showing in the first step?

I am not sure. Just guessing: could try to implement 

moduleConfigurationEditorProvider extension point

here is an example



It doesn't seem to be it. I've added to the plugin xml the extension point and added mockup code but it still shows the "Additional libraries and frameworks" section despite the module editor.

<moduleConfigurationEditorProvider implementation="com.codename1.plugin.intellij.module.CodenameOneModuleConfiguration" />

maybe implement custom ModuleBuilder and register it as moduleBuilder EP?


I figured it out. I overrode public ModuleWizardStep[] createWizardSteps(@NotNull WizardContext wizardContext, @NotNull ModulesProvider modulesProvider); Instead of overriding public ModuleWizardStep getCustomOptionsStep(WizardContext context, Disposable parentDisposable).

Once I did that with the first step it worked!

Adding the JDK code you pointed earlier to the first step should solve the rest, thanks!!!


Please sign in to leave a comment.