An error occurred while shelling out to javac

4 views (last 30 days)
I am trying to extract a jar file from matlab code using javac builder from Library Compiler(java package).
I have set as environment variable JAVA_HOME:
C:\Program Files\Java\jdk1.7.0_71
and in PATH variable:
C:\Program Files\Java\jdk1.7.0_71\bin.
When I am write in console java -version, I am getting java version jdk1.7.0_71 while when I am running javac -version I am getting jdk1.7.0_71.
However, it seems that matlab could not find javac variable, thus, I am not able to compile my .m code into .jar file. When I tried to compile .m code I got the following:
Error: An error occurred while shelling out to javac (error code = -1).
Unable to build executable.
Executing command: ""C:\Program Files\Java\jdk1.7.0_71\bin\javac"
This is the directory of my java bin folder and the file javac.exe exists : C:\Program Files\Java\jdk1.7.0_71\bin\javac? I found this link for compatibility of java compiler and Matlab2014a(which is my version) here What should I check in order to put correctly the link of Matlab and correct java version?

Answers (2)

Snake
Snake on 19 Jan 2015
Anyone?

Talha  Hasan Zia
Talha Hasan Zia on 25 Aug 2016

Categories

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

Tags

Community Treasure Hunt

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

Start Hunting!