and below is a code from the foundation library that I am using and using the same configuration defined in the example below.
From this, I am getting the below exception:
Uncaught exception thrown in Feature demoapp (CN=com.is2t.feature.demoapp, OU=IS2T, O=IS2T, L=NANTES, ST=FRANCE, C=FR):
Exception in thread “com.is2t.feature.demoapp” java.lang.RuntimeException
at java.lang.Throwable.fillInStackTrace(Throwable.java:82)
at java.lang.Throwable.(Throwable.java:32)
at java.lang.Exception.(Exception.java:14)
at java.lang.RuntimeException.(RuntimeException.java:14)
at java.io.File.(File.java:154)
at com.medtronic.neuro.LandingPage.main(LandingPage.java:36)
at com.medtronic.neuro.LandingPage.start(LandingPage.java:260)
at ej.kf.Kernel$2.run(Kernel.java:237)
at java.lang.Thread.run(Thread.java:325)
at java.lang.Thread.runWrapper(Thread.java:387)
It seems that the issue is that you are running against the FS API.
This “FS API” module is only meant for compilation and this dependency is normally replaced at build time by the implementation provided by the VEE Port / Kernel.
Let’s understand why it is not replaced.
It seems you are running a Sandboxed Application (a “feature”).
What Kernel are you using ? For your Application to access the File System Foundation Library API, the Kernel must have it in its Runtime API. https://docs.microej.com/en/latest/KernelDeveloperGuide/kernelAPI.html
Also, can you clarify which MICROEJ SDK version you are using ? SDK 5 (MMM / Eclipse) ? SDK 6 (Gradle) ?
Ok, I understand now why you have the issue at runtime instead of an error at buildtime.
The javaLibs folder is for libraries implementations packaged with VEE Ports.
In your case, you added the API jar of the File System foundation library. This jar does not contain any implementation and should be used for compilation only.
Different VEE Ports may provide different implementations (versions) of the same Foundation Library API.
So applications can depend on the same API Jar, but build against different VEE Ports for different targets using different implementations/versions of the same FS API Jar.
See Libraries — MicroEJ Documentation
What you need to do in your case is to add the FS Pack to your VEE Port.
For that, you can add our FS Pack available publicly on the MicroEJ Central Repository.