PDA

View Full Version : Errors in Matlab Java Builder



mvharish
01-26-2009, 09:07 PM
Hello,

I wrote a piece of code to find paths between obstacles in a video stream. The code works fine in Matlab.

However, when I attempted to convert the code into a Java class using the Java Builder that comes with Matlab r2007b, I get the following compilation error messages in the deployment tool outbox: (I apologize for the length of the message)


Build output( 2009-01-25 10:15:27).

mcc -F 'C:\Program Files\MATLAB\R2007b\javabuilder_examples\Untitled1 .prj'

mcc -W 'java:Untitled1,Untitled1class' -d 'C:\Program Files\MATLAB\R2007b\javabuilder_examples\Untitled1 \src' -T 'link:lib' 'class{Untitled1class:C:\Program Files\MATLAB\R2007b\javabuilder_examples\makesqr.m }'
C:\Program Files\MATLAB\R2007b\javabuilder_examples\Untitled1 \src\Untitled1\Untitled1class.java:26: '{' expected
public class Untitled1class extends MWComponentInstance
^
C:\Program Files\MATLAB\R2007b\javabuilder_examples\Untitled1 \src\Untitled1\Untitled1class.java:214: '}' expected
^
C:\Program Files\MATLAB\R2007b\javabuilder_examples\Untitled1 \src\Untitled1\Untitled1classRemote.java:43: expected
public Object[] makesqr(int nargout, Object... rhs) throws RemoteException;
^
C:\Program Files\MATLAB\R2007b\javabuilder_examples\Untitled1 \src\Untitled1\Untitled1classRemote.java:43: expected
public Object[] makesqr(int nargout, Object... rhs) throws RemoteException;
^
4 errors
Error: An error occurred while shelling out to javac (error code = 1).
Unable to build executable (specify the -v option for more information).
??? Error using ==> mcc
Error executing mcc, return status = 1.



There were errors during compilation process.


It seems that the four errors occurred when the java class was being compiled using javac.
This code is generated by the Java Builder, and, as far as I know cannot be accessed by me.
Please tell me how to solve this problem. I cannot find related information anywhere on the net.

mvharish
01-26-2009, 09:10 PM
Please note:

1. In the above case, I have followed the example given in Matlab Help word-to-word.

2. I think I've set the environment variables correctly.