How to build and debug OpenEMM by using Eclipse?

Use this forum for all questions related to the source code of OpenEMM

Moderator: moderator

aunthas
Posts: 4
Joined: Fri Aug 20, 2010 10:10 am

How to build and debug OpenEMM by using Eclipse?

Post by aunthas »

Customizing OpenEMM for me is time consuming and so cumbersome. I have to build the whole project with Ant every time I want to test my single change. This gives me only final results without any clue of debugging information.

So I would like to ask for steps on building and debugging OpenEMM by using Eclipse. Or are there other ways to mitigate this unwieldy burden?
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Post by maschoff »

Just to make sure I understand you correctly: You need an archive file containing an OpenEMM release as Eclipse project (including files .project and .classpath) which you would like to import into Eclipse?
OpenEMM Maintainer
profondino
Posts: 2
Joined: Wed Feb 09, 2011 10:22 am

Re: How to build and debug OpenEMM by using Eclipse?

Post by profondino »

To use eclipse remote debugging you first need an OpenEMM eclipse project, but this is an easy job using the open sources. Once having your project you must run the httpd java process with jdb debugging options. to reach this just add the following text to your core.sh bash:

Code: Select all

 -J-Xdebug -J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 
Than in eclipse create a new Debug Configuration of type Remote Java Application. Use connection type standard (socket attach) and set your host and port correctly (8000). Finally click Apply and Debug. Now your eclipse debug process should connect to your httpd application, which is patiently awaiting this connect (suspend=y). Setting some breakpoints will quickly enable you to jump through the running app! Hope that helps :)

Code: Select all

export LANG=en_US.UTF-8
export RESIN_HOME=$HOME

echo ""
echo "+-------------------------------"
echo "|  $1 Resin httpd server..."
echo "+-------------------------------"
echo "$HOME/bin/httpd.sh -J-Xms128m -J-Xmx512m -J-Xdebug -J-Xrunjdwp:transport=dt_socket,server=y,suspend=n -conf $HOME/conf/core.conf -server-root $HOME/webapps/core -jvm-log $HOME/webapps/core/log/openemm_jvm.log -stderr $HOME/webapps/core/log/openemm_stderr.log -stdout $HOME/webapps/core/log/openemm_stdout.log -server core -pid $HOME/var/run/core.pid $args $*"

# -J-Xdebug -J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 
$HOME/bin/httpd.sh -J-Xms128m -J-Xmx512m -conf $HOME/conf/core.conf -J-Xdebug -J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000  -server-root $HOME/webapps/core -jvm-log $HOME/webapps/core/log/openemm_jvm.log -stderr $HOME/webapps/core/log/openemm_stderr.log -stdout $HOME/webapps/core/log/openemm_stdout.log -server core -pid $HOME/var/run/core.pid $args $*
Yuna
Posts: 6
Joined: Mon Nov 04, 2013 11:55 am

Re: How to build and debug OpenEMM by using Eclipse?

Post by Yuna »

Hi,
i know this topic is a bit old. but is there a description how to get an usable eclipse version out of the source files?
i was creating a web project and was inserting the librarys in the buildpathes. but there are still some errors.
so whats missing? and my eclipse is stucking at validating "src\jsp\fckeditor-2.6.6\editor\_source"
is it even possible with windows? cause of the .sh files....
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: How to build and debug OpenEMM by using Eclipse?

Post by maschoff »

Did you read the Code Design Guide, section 2.1?
OpenEMM Maintainer
Yuna
Posts: 6
Joined: Mon Nov 04, 2013 11:55 am

Re: How to build and debug OpenEMM by using Eclipse?

Post by Yuna »

maschoff wrote:Did you read the Code Design Guide, section 2.1?
yes but there is nothing with windows or/and eclipse :S
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: How to build and debug OpenEMM by using Eclipse?

Post by maschoff »

If you want to edit OpenEMM's source code in Eclipse follow these steps:
- download and install Eclipse IDE for Java EE Developers
- create a new dynamic web project with source folders src/java + src/conf and content directory src/jsp
- unpack the OpenEMM source tarball
- import the unpacked files (and overwrite dummy files in dynamic web project)
- add all JARs from directory lib to the project's build path
Eclipse is available for both Linux and Windows.
OpenEMM Maintainer
Yuna
Posts: 6
Joined: Mon Nov 04, 2013 11:55 am

Re: How to build and debug OpenEMM by using Eclipse?

Post by Yuna »

i know :roll: but how do i set OpenEMM up in eclispe?
i would like to run it from eclipse
Anton
Posts: 46
Joined: Sun Jun 24, 2012 9:58 pm

Re: How to build and debug OpenEMM by using Eclipse?

Post by Anton »

OpenEMM is definitely not the best project for you to learn about Java programming on. The community is relatively small, and contributions from it are rare (either in support or code - I don't believe there's even community SCM).
Yuna
Posts: 6
Joined: Mon Nov 04, 2013 11:55 am

Re: How to build and debug OpenEMM by using Eclipse?

Post by Yuna »

I am not new to Java and just want to know how to run it with eclipse. i cant understand whats so difficult to tell me how set it up.
just a simple explaination what kind of eclipse project, where to put the files in, which jars i neex (cause i still have some errors after adding the jars), how to setup tomcat,....
Post Reply