0

I am trying to convert this code into Java Package using the MATLAB compiler and I'm getting this error on building. Can someone suggest anything?

'javac' is not recognized as an internal or external command,
operable program or batch file.
Error: An error occurred while shelling out to javac (error code = 1).
Unable to build executable.

Is there any specific command line to be included into the matlab function file (for example we include %#codegen for C/C++ conversion)

4
  • 1
    You say you're using MATLAB Compiler. MATLAB Compiler does not produce Java packages. Do you mean that you're using MATLAB Builder JA for Java? Apr 3, 2014 at 16:46
  • yes. but you go into that from MATLAB compiler only right? Apr 3, 2014 at 16:48
  • You don't "go into" MATLAB Builder JA "from" MATLAB Compiler. You can access the functionality of both MATLAB Compiler and MATLAB Builder JA from within deploytool, if that's what you mean. deploytool is not the same as MATLAB Compiler - it is a tool that is made available with either product, and allows you to access the functionality of either. Apr 3, 2014 at 17:00
  • Yes sir, that is exactly what i meant. I opened deploytool to use the functionality of both. But i dont think there is any problem with any of those things. Apr 3, 2014 at 17:02

1 Answer 1

1

Make sure that you have the Java compiler installed. Try executing java -version and javac -version at a system prompt, and ensure that these both run and give a version that is supported by your version of MATLAB.

Check also that your system environment variables are set appropriately. In particular the JAVA_HOME variable should be set to your JDK path.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.