"Java not enabled" in deployed app
10 views (last 30 days)
Show older comments
To showcase the issue, consider the following simple function:
function checkJavaVersion
version -java
When I execute it in Matlab I receive the following result:
>> checkJavaVersion
ans =
'Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode'
Now I am using the Matlab Compiler to deploy this function:
mcc -m checkJavaVersion.m
And I execute it in a machine (the same one that built the function) with the Matlab Runtime installed:
./run_checkJavaVersion.sh /usr/local/MATLAB/MATLAB_Runtime/v97
And here is the response:
------------------------------------------
Setting up environment variables
---
LD_LIBRARY_PATH is .:/usr/local/MATLAB/MATLAB_Runtime/v97/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v97/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v97/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v97/sys/opengl/lib/glnxa64
ans =
'Java is not enabled'
How could Java be enabled in such a scenario?
Accepted Answer
chris
on 17 Feb 2020
2 Comments
Sabine Eckhardt
on 4 Mar 2020
I think I am having exactly the same problem, however use R2019a and I get in the end not a succeed, but following message:
------------------------------------------
Setting up environment variables
---
LD_LIBRARY_PATH is .:/usr/local/MATLAB/MATLAB_Runtime/v96//runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96//bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96//sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v96//sys/opengl/lib/glnxa64
Undefined variable "java" or class "java.lang.String".
Error in checkjava (line 2)
MATLAB:undefinedVarOrClass
More Answers (0)
See Also
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!