cancel
Showing results for 
Search instead for 
Did you mean: 

[Tutorial] Install Alfresco into Eclipse

anirelles
Champ in-the-making
Champ in-the-making
Hi,

I wrote a document about setup Alfresco into Eclipse and run it. It is more detailed than what I found on Alfresco website
and maybe it can help. Don't hesitate to help me improve this document.

STEP by STEP TUTORIAL TO SET UP ALFRESCO IN ECLIPSE
+ BUILD AND LAUNCH ALFRESCO



PART 1 : SET UP ALFRESCO IN ECLIPSE


I) Install the plugin Subclipse in Eclipse


Help > Software Updates > Find and Install …

select “Search for new features to install”

select “New Remote Site”  
Name : Subclipse
URL : http://subclipse.tigris.org/update_1.4.x

follow until install Subclipse


II) Get Alfresco from SVN

create a directory called ALFRESCO_SVN into the directory workspaces of Eclipse

open Eclipse by selecting ALFRESCO_SVN as workspace directory

click : File > New > Project > SVN > Checkout Projects from SVN

choose “Create a new repository location” and use this URL : svn://svn.alfresco.com

Select the alfresco folder and click Next

Choose : “Check out as a project in the workspace” and click finish

III) Setup Eclipse

create a directory called ALFRESCO into the directory workspaces of Eclipse and switch Eclipse to this directory

Select : File > Import > General > Existing Projects into Workspace

In the dialog box select “Select Root Directory” and choose the directory “/workspace/ALFRESCO/alfresco/HEAD/root/projects”

Select all the projects except the ones starting with SDK (you don't need them to build Alfresco). Verify “Copy projects into workspace” is unchecked

Click Finish

When the import is finished build the workspace (note : after the compilation I had 42 errors, they didn't avoid the building of alfresco for me).


PART 2 : BUILD AND LAUNCH ALFRESCO


1) Install TOMCAT 5.5.x ( and not TOMCAT 6.x )


catalina.sh has to be modified to avoid Out of Memory exceptions.

Modify the line :

JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"

by the line :

JAVA_OPTS="$JAVA_OPTS -Xms256m -Xmx1024m -XX:MaxPermSize=256m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"


2) Install ImageMagick

It is necessary if you are using Linux. I don't know for Windows. I use Ubuntu and ImageMagick is present in the repositories.

3) Setup Mysql

Launch Mysql.

Create a database called “alfresco” (using PhpMyAdmin for example) and in a SQL editor execute :

grant all on alfresco.* to 'alfresco'@'localhost.localdomain' identified by 'alfresco' with grant option;
grant all on alfresco.* to 'alfresco'@'localhost' identified by 'alfresco' with grant option;

4) Add a missing jar


Copy rt.jar (you can find it in jdk1.6.0_06/jre/lib) into workspace/ALFRESCO_SVN/alfresco/HEAD/root/projects/3rd-party/lib

5) Setup Ant into Eclipse

Note : it's a copy and paste from Alfresco website

You can run the Ant targets mentioned above from within Eclipse. Firstly, you need to complete the following setup:
Create a new Simple Project (not a Java Project). I call mine Ant.
1.Right click on the Ant project and select New > File.
2.Click the Advanced button.
3.Select the option Link to file in the filesystem.
4.Browse for the build.xml file. If you expanded to c:\alfresco you need to browse to c:\alfresco\common, select build.xml and click the Open button.
5.Enter build.xml in the File name field.
6.Click Finish.
You should now see a link to build.xml in your Ant project. Double-click the file to see the contents. Eclipse also has several options to allow you to run targets in the file.
One way is to use the Outline window as it shows you all the targets in the project. Find the target you want to run and right click. Choose Run As > Ant build.
If you get errors because the environment variables, like TOMCAT_HOME, are not defined, then you can define them via Window > Preferences > Ant > Runtime > Properties and add env.TOMCAT_HOME

5) Compile and deploy Alfresco

Right click build.xml and choose Run As > Ant Build

6) Access Alfresco

launch tomcat
access Alfresco at http://localhost:8080/alfresco
user : admin, password : admin
35 REPLIES 35

mrogers
Star Contributor
Star Contributor

kennethcasero
Champ in-the-making
Champ in-the-making
catalina.sh has to be modified to avoid Out of Memory exceptions.

Modify the line :

JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"

by the line :

JAVA_OPTS="$JAVA_OPTS -Xms256m -Xmx1024m -XX:MaxPermSize=256m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"


i cant seem to find catalina.sh in my tomcat folder. can someone please tell me where to locate it? thanks you very much for your help

mrogers
Star Contributor
Star Contributor
It should be in the "bin" dir.   Ie Tomcat/bin

kennethcasero
Champ in-the-making
Champ in-the-making
4.Browse for the build.xml file. If you expanded to c:\alfresco you need to browse to c:\alfresco\common, select build.xml and click the Open button.

i cant seem to find the "common" folder in my alfresco directory. where can i find my "build.xml"?

i am using alfresco 3.2
thank you for all your responses

chariflorsupino
Champ in-the-making
Champ in-the-making
when i built my alfresco, i have this error:

Description   Resource   Path   Location   Type
Project 'Extension Samples' is missing required source folder: 'source/java'   Extension Samples      Build path   Build Path Problem

how to resolve this?

jmuras
Champ in-the-making
Champ in-the-making
You might also find the following https://forums.alfresco.com/en/viewtopic.php?f=10&t=43375 useful.

Thanks,
Joanna

himansu
Champ in-the-making
Champ in-the-making
Hi All,
While configuring the svn ie ,Create a new repository location” and use this URL : svn://svn.alfresco.com
Select the alfresco folder and click Next then
i am getting the error like this "The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. 
svn: Unknown hostname 'svn.alfresco.com'"

Please provide me any solution.

Thanks
Himansu

pmverma
Champ in-the-making
Champ in-the-making

pankaj_dell
Champ in-the-making
Champ in-the-making
Hi all,

I have checked out alfresco projects into my local directory. Now I am getting following errors on build.
I am using jdk 1.6 as given in developing guide, but Java 7 is required to build.
   
If I am not wrong then wanna suggest to all of you use Java 7 to access Alfresco.


Buildfile: C:\Repo\alfresco\HEAD\root\build.xml

BUILD FAILED
C:\Repo\alfresco\HEAD\root\build.xml:24: Java 7 is required to build. 1.6.0_39 detected

Total time: 249 milliseconds

Hi Pankaj,
Current community requires Java 7 to build. So make your, you java 7 installed and it is available for compilation.

http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/build.xml