2

I'm trying to wrap a program of mine to work with java. I tried a simple "hello world" first,

-hello world.m-

disp('hello world');

I used deploytool and selected java package.

when it reached this line: Executing command: "javac -verbose -classpath "C:\Program Files\MATLAB\R2009b\toolbox\javabuilder\jar\javabuilder.jar" -d "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\classes" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2\helloworld.java" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2\DeployTutorial2MCRFactory.java" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2\helloworldRemote.java" "C:\Users\shachar\Documents\MATLAB\deployTutorial\deployTutorial2\src\deployTutorial2\package-info.java""

I got this error: '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.

btw: when I tried standalone application / c/c++ shared library it has been compiled successfully.

thanks in advance

2 Answers 2

1

Possibly the Java SDK is not installed or properly configured on your machine. Open a system terminal and execute the following two commands:

java -version
javac -version

If they both work you should proceed with the examples from the MATLAB help. If not install the Java SDK.

Sign up to request clarification or add additional context in comments.

Comments

0

First you should install JAVA.
Then you must set the environment variable in "my computer"
Add a new variable named "JAVA_HOME" and set its value to your jdk path
like D:\Program\Java\jdk1.6.0_25
Then restart your matlab
and type

getenv JAVA_HOME  

you should get
ans=

D:\Program\Java\jdk1.6.0_25  

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.