cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with STM32CubeMX install on Mac

WSank
Associate II

I'm running MacOS Mojave 10.14.3, trying to install STMcubeMX 5.1.0. I had to install Java 6 legacy and also JRE 8 build 201. When I try to install from the "en" directory created by the STM32cubeMX download using a terminal, here's what I get: (tried <return> as password the first time which was clearly wrong)

What am I doing wrong ?

computer-name:en userid$ sudo java -jar SetupSTM32CubeMX-5.1.0.exe

Password:

Sorry, try again.

Password:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/st/microxplorer/install/Main : Unsupported major.minor version 51.0

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)

at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

6 REPLIES 6
Noppe.Jack
Senior

This is the exact environment and procedure that I used to install on my Mac and it worked. Some thoughts for you ...

1) Verify that the command line is picking up the right version of java, by executing 'java -version'. The requirements for CubeMX states "On MacOS: Java Development Kit (minimum version 1.7.0_45)"

2) If that checks out, try typing in 'XCode' in your Spotlight and running it to make sure it starts up correctly.

john doe
Lead

Don't install it as root, and dont put it in Applications.

WSank
Associate II

Hello all,

Thanks for the replies.

I can't see that JDK is needed - I searched all around the CubeMX docs and can't find any reference to it. I'm pretty sure I don't have it but from what I read I can't see now it's needed.

I'm not sure what to do about this, I seem to have 2 versions of JRE:

computer-name:~ userid$ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

java version "1.8.0_201"

Java(TM) SE Runtime Environment (build 1.8.0_201-b09)

Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

computer_name:~ userid$ which java

/usr/bin/java

computer-name:~ userid$ java -version

java version "1.6.0_65"

Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468)

Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)

computer-name:~ userid$

I don't know if I have to remove the 1.6.0 version somehow or remove both and reinstall the 1.8.0_201 version ?

WSank
Associate II

OK I think I've found something intestine. On this page:

https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-macos.htm#JSJIG-GUID-2432241F-9517-4C0B-9CBB-489E6419C9C9

it says:

12. I have Oracle's version of the JRE installed, but when I try to run the java command from the command line, it does not work.

Installing a JRE from Oracle does not update java -version symlinks or add the java command to your path. For this functionality, you must install the full JDK.

I'll try to install the JDK and see what happens.

WSank
Associate II

OK that worked, thanks for the help !!!

WSank
Associate II

So... what happens if install as root in applications?

The alternative is ??? install as user and in something like /user/user_name/Applications ?