Friday, October 31, 2014

Enable J2EE project or Java Web Project for Scala Code

Now a days, it has been very common to use SCALA programming language in Java based project. This may be chosen to get advantage of SCALA's multithreaded nature or this can also be done to slowly migrate Java based Web application from Java to Scala.

Recently, I had to integrate scala in a J2EE web project having JSP pages and Java classes. Here is what I could find out about integrating scala in J2EE project in Eclipse:

Pre-requisites:
1.) You have Eclipse platform with J2EE project setup.
2.) Your eclipse is enabled for SCALA

How to enable your J2EE project so that it can also run SCALA code?

Right click your Dynamic Web project --> Configuration --> Add Scala Nature.




Once you do this, the Eclipse will add SCALA libraries to your web project and your project will be able to compile and run the SCALA code just like Java Code.

Good Luck!

No comments:

Post a Comment