Deploy .m (Matlab) to .java and .jar (Java Application) On Windows OS [part 1]

Before doing the Deploy source code *.m Into. Java and. Jar, we first do the following tricks to enable MATLAB JA Builder (Java Application), Recommended minimal use Matlab 2009 :

  • Install MCRInstaller.exe
    (Take MCRInstaller file in folder :
    “C:\Program Files\MATLAB\R2009a\toolbox\compiler\deploy\win32\MCRInstaller.exe”)

    MCRInstaller File

    MCRInstaller File

    note: address MCRInstaller file “C:\Program Files\MATLAB\R2009a\toolbox\compiler\deploy\win32\MCRInstaller.exe” may be different with your computer. Because this MCRInstaller file address matches the address of where we install Matlab. So take this MCRInstaller file as it is on your computer.

  • Open cmd windows, and then check whether javac (java component) has been active on your computer with the command “javac-version” (without the quotes). If you have not done, then headed step 3.

    java component

    java component

  • Open Control Panel \ System and Security \ System” (If you are using Windows 7).

    Control Panel Win7

    Control Panel Win7

  • Click “Advanced system setting”, then click “Advanced” tab,

    Advanced system setting

    Advanced system setting

  • If you are using Windows XP. Open the “Control Panel”, then click “Performance and Maintenance” and then click “System”, then click the “Advanced” tab.

    Performance and Maintenance

    Performance and Maintenance

  • Click the “Environment Variables” button.

    Environment Variables

    Environment Variables

  • Find in the “System variables” that Variable named “Path”.

    System variables

    System Variables

  • Click the “Edit” button.

    Edit button

    Edit button

  • Add the following value “;C:\Program Files\Java\jdk1.6.0_16\bin” (without quotation marks) in the Variable value. Then click the “OK” button.
    Edit System Variable

    Edit System Variable

    note: value “;C:\Program Files\Java\jdk1.6.0_16\bin” could be different with your computer. Because the address of this value corresponds to the version we install jdk. So take this value According to the address you have in your computer.

    Javac Location

    Javac Location

    note: Notice the text on the part that has a gray background color, the entire contents of the Variable value in the computer we have copy-paste it in Notepad ++, hopefully can be used as a reference. (Fill all the Variable value is only 1 line or 1 line only).

    All Contents of the Variable Value

    All Contents of the Variable Value

  • Check javac version. Close cmd if it is still active, we open cmd windows again, then we type the command “javac-version” (without quotes) will display as shown below.

    Javac Check Again

    Javac Check Again

  • Congratulation, javac (java component) has been active on your computer. 🙂
  • To be Continue On [part 2]

About matlabfreecode

This Blog Want to Tags Any Coding of MATLAB Programming Language is being Created by Experiment or Other Implementation Which Interesting. by : matlabfreecode@gmail.com

Posted on October 8, 2012, in Deploy .m to .jar, Deploy .m to .java, Matlab Compiling, Matlab Developer and tagged , , , , , . Bookmark the permalink. Leave a comment.

Leave a comment