cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a STM32 Project in STM32CubeIDE 1.3.1 on Windows 10 x64 fails with Java exception

JMors.1
Associate III

I'm having an issue where STM32CubeIDE is experiencing a Java exception when I attempt to create a STM32 Project.

The following is the output from the IDE log

!SESSION 2020-07-01 17:40:06.274 -----------------------------------------------
eclipse.buildId=Version 1.3.1
java.version=1.8.0_202
java.vendor=AdoptOpenJdk
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data C:\Users\jomodev\STM32CubeIDE\workspace_1mems
 
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2020-07-01 17:40:15.371
!MESSAGE Log4j initialized with config file C:\Users\jomodev\STM32CubeIDE\workspace_1mems\.metadata\.log4j.xml
 
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2020-07-01 17:40:19.969
!MESSAGE Started RMI Server, listening on port 41337
 
!ENTRY com.st.stm32cube.ide.mcu.ide 4 4 2020-07-01 17:40:20.994
!MESSAGE com.st.stm32cube.ide.mcu.ide/META-INF/version/build_ref file not found, build reference will not be reported into properties
!SESSION 2020-07-01 18:01:25.398 -----------------------------------------------
eclipse.buildId=Version 1.3.1
java.version=1.8.0_202
java.vendor=AdoptOpenJdk
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86_64
 
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2020-07-01 18:04:01.045
!MESSAGE Log4j initialized with config file C:\Users\jomodev\STM32CubeIDE\workspace_1mems\.metadata\.log4j.xml
 
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2020-07-01 18:04:07.595
!MESSAGE Started RMI Server, listening on port 41337
 
!ENTRY com.st.stm32cube.ide.mcu.ide 4 4 2020-07-01 18:04:08.438
!MESSAGE com.st.stm32cube.ide.mcu.ide/META-INF/version/build_ref file not found, build reference will not be reported into properties
 
!ENTRY org.eclipse.ui 4 0 2020-07-01 18:04:27.703
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at com.st.stm32cube.common.ecosystemintegration.ui.core.MCUEcoSystemIntegrationUiHelper.getTargetSelector(MCUEcoSystemIntegrationUiHelper.java:78)
	at com.st.stm32cube.common.projectcreation.ui.wizard.TargetSetupPage.createControl(TargetSetupPage.java:92)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:179)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:743)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:635)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
	at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:119)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:412)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4173)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3986)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3585)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
 
!ENTRY org.eclipse.ui 4 4 2020-07-01 18:04:59.647
!MESSAGE Failed to retrieve data for section: section.installed.bundles
!STACK 0
java.lang.NullPointerException
	at java.util.HashMap.merge(HashMap.java:1225)
	at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320)
	at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.eclipse.e4.core.internal.services.about.InstalledBundles.append(InstalledBundles.java:36)
	at org.eclipse.ui.internal.about.ConfigurationLogDefaultSection.appendSection(ConfigurationLogDefaultSection.java:65)
	at org.eclipse.ui.internal.about.ConfigurationLogDefaultSection.write(ConfigurationLogDefaultSection.java:49)
	at org.eclipse.ui.internal.ConfigurationInfo.appendExtensions(ConfigurationInfo.java:102)
	at org.eclipse.ui.internal.ConfigurationInfo.getSystemSummary(ConfigurationInfo.java:74)
	at org.eclipse.ui.internal.about.AboutSystemPage.lambda$0(AboutSystemPage.java:142)
	at org.eclipse.core.runtime.jobs.Job$1.run(Job.java:164)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

7 REPLIES 7
TDK
Guru

STM32CubeIDE doesn't play well with OpenJDK. This question has come up before. Some people have found workarounds:

https://community.st.com/s/question/0D50X0000B8hXhZ/with-windows-10-i-installed-openjdk-version-180222-but-stm32cubemx-does-not-see-that-openjdk-is-there-says-it-can-not-find-java-runtime-environment-the-readme-with-stm32cubemx-said-openjdk-would-work

If you feel a post has answered your question, please click "Accept as Solution".
JMors.1
Associate III

Interesting. I have no indication that I have OpenJDK install on the system so I am not sure where it is picking this up from.

java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

TDK
Guru

Weird. I just assumed since your log shows "java.vendor=AdoptOpenJdk".

In any case, the log doesn't match what you're getting back with the "java -version" command. The version number is different as well. Likely there is another Java version floating around somewhere.

If you feel a post has answered your question, please click "Accept as Solution".
JMors.1
Associate III

Looks like STM32CubeIDE install this AdoptOpenJDK version of Java:

H:\Development\STM\STMicroelectronics\STM32CubeIDE_1.2.0\STM32CubeIDE>jre\bin\java -version
openjdk version "1.8.0_202"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.202-b08, mixed mode)

So, if STM32CubeIDE does not play well with OpenJDK, then why did it install this version of Java?

That’s a good question.
My comment was based on forum posts I’ve seen about it. Seems like if STMCubeIDE installs its own Java then people shouldn’t need to worry about installing their own version. Which brings up questions about why people are doing that. Maybe it has changed with a recent version.
In any case, I can’t help with the original question. Sorry for the noise.
If you feel a post has answered your question, please click "Accept as Solution".
JMors.1
Associate III

Actually, your comments were helpful in narrowing it down to where the extra Java version was and I appreciate your responses.

Now to understand why it will not work in my env. Perhaps since I have the tool installed in an non "c:\" location is is causing a path issue.

I'll have to play with this and see if I can resolve it. I do have a version that is working on a Ubuntu VM which will work in the mean time.

Cheers,

Jon

JMors.1
Associate III

So, I removed the 1.3.1 version of STM32CubeIDE and then installed the 1.3.0 version and now it is working again. Interesting, this version also uses OpenJDK but a newer version.

C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE>jre\bin\java.exe -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)

One note though, I did let it install into the default location of "C:\ST\STM32CubeIDE_1.3.0\STM32CubeIDE"

I'll just ignore the update to 1.3.1 for the time being.