Java Error when call function fom .net assembly in c#

2 views (last 30 days)
I developed several algorithms in matlab and i want to use this on a web page that i developed. so i compiled the algorithms using .net assembly from the matlab compiler. I added the assembly in visual studio project and when i use some of the algorithms the mrc start running and then it pop up an warning saying :
unable to load java runtime environment.
after pressed ok another warning: Disabling Java Support. at last i received this error: mkl.dll the specified module could not be found
I searched over the internet and i cant find a solution for this.
i read somewhere that i need an Environment variable from jdk path, but i have done this and still no sucess.
I appreciate if someone can help me.

Accepted Answer

Friedrich
Friedrich on 18 Jul 2013
Edited: Friedrich on 18 Jul 2013
Hi,
are you using R2013a? If so, the second error regarding the mkl.dll could be this:
The first parts sounds like an out of memory error or something. Loading the JVM means allocating at least 192mb of memory (or the value you set in your MATLAB preferenceses, default would be 192mb). I doubt that you need JAVA four your MATLAB program. If so, you can disable it right away from your .NET application:
[assembly: NOJVM(true)
  3 Comments
Friedrich
Friedrich on 22 Jul 2013
The easiest would be moving to 64bit in order to resolve any memory issue you are facing. It could also more a memory fragmentation problem. Maybe try creating an instance of your MATLAB class right at the beginning (basically first line of your code) where the memory fragmentation should be smaller.
Fernando
Fernando on 23 Jul 2013
Creating the object in the beginning of the application has resolved the problem.
Thank you for your help.

Sign in to comment.

More Answers (0)

Categories

Find more on Java Package Integration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!