[RESOLVED] Error when building a platform: "could not access native libraries"

Hi,

I’m resuming an old project using MicroEJ SDK 4.1.5.

However, I got the following error at platform build:

(note that I installed this SDK version more than 3 years ago, my laptop configuration may have changed since then).

I there a way to fix the issue or shall I need to re-install MicroEJ SDK from scratch ?

Thanks in advance,

Lucas,

Hello Lucas,

This error shows up when the MicroEJ SDK doesn’t manage to find the dongle drivers. The most likely reason for this to occur is that there is an incompatibility in your environment setup.

Could you check the following things:

  • Is your OS 64 bits?
  • Is your installed version of the MicroEJ SDK v4.1.5 is 64 bits ? It can be easily checked by looking at its installation path:
    • C:\Program Files\MicroEJ is a 64 bits version
    • C:\Program Files (x86)\MicroEJ is a 32 bits version
  • Is your installed version of Java SE is 64 bits ?
  • Are you using both a 32 bits and a 64 bits version of Java on your system ?

Let me know if you have any troubles checking those things.

Best regards,

Alex

Hi Alex,

  • OS: 64bits version (Windows 10)
  • MicroEJ SDK 4.1.5: 32 bits version (installed in C:\Program Files (x86)\MicroEJ)
  • Java: 32bits and 64bits version (installed in C:\Program Files (x86)\Java\jre1.8.0_221 and C:\Program Files\Java\jre1.8.0_66)

Hello Lucas,

Your MicroEJ SDK may use the 64 bits version of Java instead of the 32 bits version.

Could you check this in your MicroEJ SDK ?

  • Go to : Help > About > Installation > Configuration
  • Look for the -vm options line and send me its value

Best regards,

Alex

Hi Alex,

Here is the VM I use.

-vm
C:\Program Files (x86)\Java\jre1.8.0_221\bin\server\jvm.dll

It is a 32bits version so it seems to be in sync with my SDK. Any other hint ?

Hello Lucas,

You’re right, it is a 32 bits version. Then, could you check which JRE is used in your SDK ?

  • Window -> Preferences -> Java -> Installed JREs

Alex

The JRE installed is the 64bits version

image

Should it be the 32bits version ?

Hello Lucas,

The problem should come from there. The VM used to launch the SDK must have the same architecture that the JRE (32 bits).

To change the installed JRE version, follow those steps:

  • Go to the Installed JREs window
  • Click the Add button
  • Select Standard VM
  • Add the path to your JRE home, in your case it should be : C:\Program Files (x86)\Java\jre1.8.0_221
  • Click Finish to add this new JRE
  • Make it default by checking the checkbox in the Name column
  • Delete the former JRE (64 bits one) and apply changes
  • Try to re-build your platform

Let me know if the problem still shows up.

Best Regards,

Alex

Yes, this works now, the platform build is OK.
I’m curious to understand what could I’ve done in the past to get this situation. Do you have any idea ?

It can happen when the workspace is created with a certain version of MicroEJ SDK and used with an other version. The JRE path is set according to the JRE witch executes Eclipse when the workspace is created.

In your case, your workspace may have been created / duplicated from a 64 bits version.

Alex

OK I see. I also have a 64bits version for an other project, I may have used the same workspace with both versions in the past.
Many thanks Alex.