Home > JAVA, Matlab, Ubuntu Geek > PJUG – the first contact [part 2] Ubuntu env. setup for Matlab JavaEE

PJUG – the first contact [part 2] Ubuntu env. setup for Matlab JavaEE

I’m back again as I have promised in my last post. Today i’m gonna show how to setup your Ubuntu 9.04 operating system and Tomcat 6.x for your Matlab JavaEE application development. I hope you are ready. Let’s start with … !

During my googling time I didn’t search any blogpost focused on that topic even from Windows. That was little bit surprise to me.  I found only several nice examples which were only on image. No describtion how deploy them.  So my enviroin ment setup became to be more chanlenging to me.

What you need to follow me.  My system is Ubuntu 9.04, JDK 1.6.0_16, Tomcat 6.x, IntelliJ IDEA 8.1.3,  Matlab 2009b and MATLAB Builder JA 2.0.4 for Java language.

I expected you have installed you IDE correctly so I’m skipping this and I start:

  • Install JDK 1.6 or higher as it’s recommended
  • Install Matlab 2009b to your $MATLABROOT folder
  • Setup properly you environment properties. They have to be linked with your Matlab because you will need them for your application compilation.  You may set up them to your .bashrc using for example gedit. It’s up to you.  You have to setup these variables $LD_LIBRARY_PATH and $XAPPLRESDIR.  Here is a help what to specify:

export LD_LIBRARY_PATH=$matlabroot/runtime/glnx86:$matlabroot/bin/glnx86:$matlabroot/sys/os/glnx86/:$matlabroot/sys/java/jre/glnx86/jre/lib/i386/native_threads:$matlabroot/sys/java/jre/glnx86/jre/lib/i386/server:$matlabroot/sys/java/jre/glnx86/jre/lib/i386/:${LD_LIBRARY_PATH}
export XAPPLRESDIR=$matlabroot/X11/app-defaults

# XAPPLRESDIR access to Matlab graphical functions as plot, figure

  • Next task is to install Tomcat 6.x. I have used it from Ubuntu repository.  Then you should link it with your IDE but I guess it’s simple task for you as you are familiar with.
  • Very important point connected with Tomcat 6.x usage for Matlab JavaEE applications deployment is to do change in <TOMCAT FOLDER>/conf/context.xml. Just after tag <Context> place following tag with properties <Loader delegate=”true”/>

This is problem caused by org.apache.AnnotationProcessor due to efforts from MYFACES-1246. The statement makes classloading in Tomcat sticking to JavaEE specification. This bug was really stupid.

Now is your system ready to start with JavaSE and JavaEE App development. I will gonna show in next text. Stay tuned I hope you are still involved.

About these ads
Categories: JAVA, Matlab, Ubuntu Geek
  1. December 10, 2009 at 10:30 am

    Mirek,

    Your JavaCamp presentation was really cool. I am very happy that you are blogging about it because I would like to write a sample Java-Matlab application myself! Your blog entries are really helpful, but I am waiting for the next parts :) It would be also great if you could publish the projects/code that you showed during JavaCamp.

    Cheers,
    Tomek Bujok

    P.S. You can find a review of your session on my website :)

    • miragemiko
      December 10, 2009 at 9:51 pm

      Hi Tomek, I’m really glad you enjoy it! As you can see now I’m doing clear description about the how to make it works on Ubuntu :). I guess for Windows it could be better but about the issue with Tomcat 6 I’m not sure ;) I haven’t tested it. I’m planning to post also short movie how to use JSP/Servlet technology with Matlab very soon;)
      I’m looking forward to come back again.
      Cheers,
      M.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: