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
Good work!

If there is something on the wiki that you don't like, is unclear or can be improved then just go ahead and update it.  Could you contribute your improvements to the wiki please?

anirelles
Champ in-the-making
Champ in-the-making
Thank you, actually the wiki is good, I succeed to setup Eclipse only with the wiki. The only little thing is that I had to add rt.jar in 3rd-party/lib in order to run build.xml from Eclipse.

lakshya
Champ in-the-making
Champ in-the-making
Thanks a lot for sharing these steps.

But I am facing some problem while installing 'New Remote Site'. It doesn't enable 'Next' button when I add http://subclipse.tigris.org/update_1.4.x.
And when I click on Finish it gives
– Unable to access http://subclipse.tigris.org/update_1.4.x.

I am using  Eclipse 3.2.0.

Can anyone send some pointers for this.

Regards

bradai
Champ in-the-making
Champ in-the-making
Try to deselect the case for the optional instal of Mylyn add-in

midhun
Champ in-the-making
Champ in-the-making
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 got  error  "No connection could be made because the target machine actively refused it. 
svn: Can't connect to host 'svn.alfresco.com': No connection could be made because the target machine actively refused it. "
What could be the reason  any idea

zomurn
Champ in-the-making
Champ in-the-making
Get from alfresco SVN ?? wowww..this is snapshot version , not release isn't it ?

lakshya
Champ in-the-making
Champ in-the-making
Hello,
I am getting error while find & install step

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

follow until install Subclipse


I am getting
'Network connection problem encountered during search'

Can any one solve this….

skorde
Champ in-the-making
Champ in-the-making
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 got error "No connection could be made because the target machine actively refused it.
svn: Can't connect to host 'svn.alfresco.com': No connection could be made because the target machine actively refused it. "
What could be the reason any idea

Hi
I am getting same problem while accessing alfresco svn. How do i resolve this issue.

anitha
Champ in-the-making
Champ in-the-making
Hi..
I followed your document to install alfresco through eclipse. I succeeded in building and deploying the war file to tomcat, but when i start the application the following error message is displayed:
Fail-the application at context path /alfresco can not be started.

Please help me in resolving this issue..