Menu

Create an eclipse developing environment

Developers
2007-02-23
2013-03-08
  • Mario Calderon

    Mario Calderon - 2007-02-23

    Hi,

    after doing at least 6 installations of Adempiere and databases, peeking into Adempiere's Dictionary, Tables, Views and Reports, I felt confident enough to start compiling. Maybe I can help finding bugs and implementing. My (limited indeed) last java programming expierence dates three years ago, so I have to learn  many things again. But I have OO and DB experience, so it should go OK.

    Here's my problem:
    I wanted to set up an eclipse 3.2.2 developing environment on linux 10.1 Enterprise and Oracle 10g. I have read the wiki and it has helped a lot.

    1- The download of eclipse and updating was easy.
    2- The installation of Subclipse was more difficult (site-1.2.0), since I struggled with the "Subclips mylar integration". After looking in the internet and deselecting it, the installation of Subclipse succeeded.
    3- I could open Adempiere in the SVN Repository
    4- When I tried to check out single packages (or bunches of them), as recommended in the wiki, selected the workspace and proceeded to the actual check out, most of the time and after a while I got an error dialog without title with text like "/usr/bin/java Xms40m Xmx256m jar /data2/app/eclipse/startup.jar ....".
    5-Eclipse vanishes after quitting the error dialog. If I call eclipse again, it starts, but freezes during the splash. I have to restart the operating system in order to see eclipse start correctly.
    6- Sometimes the package was there, sometimes with a mark which resembled an error to me. Nevertheless, I deleted the files and the projects in Eclipse.

    Maybe I have missed something so that I cannot check out the packages correctly? With netbeans I could check out the hole trunk at once.

    Maybe a compassionate developer has gone through this and (as mostly happens) remembers that I have to switch a button here or there and suddenly there is no errors, just pure joy and compiling errors.

    Thank you in advance for every contribution.

    Mario

     
    • Joel Stangeland

      Joel Stangeland - 2007-02-23

      Hello Mario,

      I don't have any experience with that particular problem, but did want to say:

      Welcome to the ADempiere Community!  We are glad to have you and will help as much as we can.

      Joel Stangeland
      www.idalica.com

       
    • Mario Calderon

      Mario Calderon - 2007-02-23

      Thanks Joel. You know, although very new, novice, and inexperienced in Adempiere, I consider myself as part of the ADempiere community and want to contribute (perhaps later than sooner, but I will).

      Now that you read this thread, I wanted to thank you for the very useful contributions of Idalica.

      Mario

       
    • Heng Sin

      Heng Sin - 2007-02-24

      Hi,

      This looks like an out of memory error or the jvm simply crash. What version of jdk u are using ? For eclipse, try turn off automatic compilation in workbench preference and change Xmx256m to Xmx512m

      hope this help.

      Regards,
      Low

       
    • Carlos Ruiz

      Carlos Ruiz - 2007-02-24

      Hi Mario, I can't help you with these specific problems but I can recommend you the way I do development.

      I use TortoiseSVN in Windows XP - works very well to hide all the svn stuff and integrate it directly on windows explorer.

      And contrary to the wiki recommendations I download and use in eclipse only one project.

      In other words, I download the whole trunk (or desired tag or branch) with tortoiseSVN (some times the first checkout break, just continue with update).

      Then I create a workspace in eclipse and create a new java project pointing to the root directory of trunk (or desired tag or branch).
      I always have worked this way and never have had problems with this approach.

      Regards,

      Carlos Ruiz

       
      • Trifon (An ADempiere founder)

        Hi,

        >And contrary to the wiki recommendations I download and use in eclipse only one project.
        >
        >In other words, I download the whole trunk (or desired tag or branch) with tortoiseSVN (some >times the first checkout break, just continue with update).

        I work with multiple project in Eclipse. By this way i can close some projects in Eclipse and reduce memory usage. Multiple projects allow me to use project dependency.

        Both ways are possible. It is choice of developer to choose one and work with it.

        Kind regards,
        Trifon

         
    • Redhuan D. Oon

      Redhuan D. Oon - 2007-02-24

      Hi Mario,
      You are now within the main radar screens. Your name now appears in http://www.adempiere.org . Hope u allow that, since u considered yourself part of the community. We look forward to your other important SME messages.

      About tortoise i find it too much clutter. But i m happy that Carlos approves of putting everything into a single project as i do for eclipse. If Eclipse bombs out as it occasionally happens on mine, its due to resources limitations and so Hengsin's advice above is important.

      If SVN update falters, it is also common and u merely delete your local folder and reupdate that folder again, or resynch. Eclipse SVN always efficiently remembers what u missed.

      Adding to what Joel said, U are at HOME!... do not be a stranger now.

      red1

       
    • Mario Calderon

      Mario Calderon - 2007-02-26

      Hi,

      tanks for your support. I really appreciate it.

      In the hope of getting the ideal environment (or what I think it is), I want to follow all recommendations and decide for the best environment (or the only one which I get running).

      Low, red1, trifon (eclipse on linux):
      "What version of jdk u are using?"
      typing in "java -version", I get
      java version "1.4.2_11"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
      Java HotSpot(TM) Client VM (build 1.4.2_11-b06, mixed mode)

      Is it actual enough? Though I have installed jre1.5.0_11 in /usr/lib,  I do not know how to make this the official version for eclipse.

      "try turn off automatic compilation in workbench preference"
      In Window/Preferences, Java/Compiler I do not find any Checkbox or Combobox who turns off automatic compilation. Where do I set it?

      ".... and change Xmx256m to Xmx512m"
      My Memory is 768 MB.
      After many google searches and reading lots of pages, I started eclipse with the option "-Xmx512". As it did not work, I changed in eclipse.ini the parameter to -Xmx512m, which I can see in the Details, so I think I increased memory. As soon as I opened svn repository, or started checking out, eclipse crashes with the "jmv terminated, Exit Code =-1 /usr/bin/java -Xmx512m" error. Sometimes I had checked ot 3, 5 packages. I have tried at least 20 times to check out (single packages, the whole trunk, bunches of packages), the result is always jvm error.  Should I increase RAM? to which amount?. I will run tomorrow and buy the memory (today is no e-distributor open).
      Netbeans allows me to check out differences, which I do not see in Eclipse/subclipse. Is there a way? (I'm just dreaming of the time I have all checked out).

      I wanted to outsmart svn by importing the trunk, but it asked me for a login/password. Sure, with the login/password I could also export, which could be very dangerous...

      Carlos (eclipse on XP)
      "I use TortoiseSVN in Windows XP.."
      I downloaded Eclipse for Windows XP and Tortoise to a PC. I get a CVS menue in Eclipse.
      Then I go to Window/Show View/CVS Repository and there I choose with the context menue a new Reposytory location.
      Apparently, the parameters I type in for the host (http://svn.sourceforge.net/viewvc/adempiere, as stated in the Hacker's Guide) and user (anonymous) are wrong, because I get the error "Invalid Host Name". Changing the Connection Type to ext, extssh, pserverssh2 does not change the error either.
      Maybe Carlos you could tell me the right pars to Add a new CVS repository?

      Summary:
      It seems that the only environment where I have succeeded checkin out is Netbeans 5.5 on Linux, where I rapidly can check out the changes. But as many of you guy seem to work with Eclipse, and because of my stubbornness, I would like to continue until I can see "Hallo World" in the console.
      Again, thanks for every kind help.

      Mario

       
      • Heng Sin

        Heng Sin - 2007-02-26

        Mario,

        You need jdk 1.5 to work with adempiere source. You can define in eclipse.ini which jvm to use, google a bit to find out the actual syntax.

        For checkout, you can refer to this https://sourceforge.net/forum/message.php?msg_id=4177999

        Auto compilation preference is under General -> Workspace, looks for the 'build automatically' check box.

        Regards,
        Low

         
      • Carlos Ruiz

        Carlos Ruiz - 2007-02-26

        > Maybe Carlos you could tell me the right pars to Add a new CVS repository?

        Mario, TortoiseSVN is integrated with windows explorer, not with Eclipse.

        So, the easy instructions can be:

        - Create a directory C:\srcAdempiere\trunk
        - Open windows explorer and navigate to C:\srcAdempiere\trunk
        - Right click on trunk and choose "SVN checkout"
        - Fill URL of repository with:
        https://adempiere.svn.sourceforge.net/svnroot/adempiere/trunk
        - Click OK

        It must start checking out the trunk immediately without asking passwords.

        If the connection broke in the middle of checkout, you just right-click on trunk and select "SVN update" option.

        TortoiseSVN show meaningful icons in windows explorer, and you can add specific SVN columns to explorer (like SVN status, revision, URL, short URL, mime-type, lock owner, eol-style)

        Regards,

        Carlos Ruiz

         
    • Mario Calderon

      Mario Calderon - 2007-02-26

      Hi,

      Low
      "You need jdk 1.5 to work with adempiere source"
      I am going to gather information, change eclipse.ini asap and try compiling.

      Carlos (Tortoise)
      Thanks to your tips, it worked fine. Maybe because I started the checkout at 1 am on Monday there was no interruption. Or beginner's luck :). Ah yes, my error: I had installed Tortoise CVS instead of SVN. Too many downloads and installs in a short period of time (and on Sunday) bedazzeld my mind.
      That means, I can soon start compiling in Windows XP.

      Two questions:
      1- Is there anything I have to set in eclipse or Windows in order to compile?
      2- And one last thing, Carlos, as I did the checkout with Tortoise from IE instead of let's say the eclipse IDE, does it mean I could compile with eclipse OR netbeans?

      The solutions seem to outweigh the errors. I am grateful indeed.

      Mario

       
      • Carlos Ruiz

        Carlos Ruiz - 2007-02-27

        > as I did the checkout with Tortoise from IE instead of let's
        > say the eclipse IDE, does it mean I could compile with eclipse
        > OR netbeans? 

        Yes, you can compile with both tools, some people use netbeans to compile and test.

        Just we found that netbeans is changing the tabulations inside files (maybe is just a parameter, I don't know netbeans), so we prefer developers use eclipse.  But for constructing and testing is ok.

        Regards,

        Carlos Ruiz

         
    • Redhuan D. Oon

      Redhuan D. Oon - 2007-02-27

      Mario,
      If the SVN ask u for a password, u most likely set that repository access with intent of commit back to the SVN, and thus it tries to qualify u first. U have to check up some property setting that u are accessing unimportantly (anon).

      Happily i mean sadly i do not have a linux machine on. I test mainly on Windows env. :D

       
    • Mario Calderon

      Mario Calderon - 2007-02-27

      Hi!
      You all are really kind.

      1.- Windows XP
      So far, I have downloaded the actual trunk at once on two XP PCs with Tortoise as Carlos stated. It (seldom) stucks, but you can resume either by updating, cleaning up or deleting the bad directory. I only monitor the download and intervene if needed.

      2.- Linux Enterprise 10
      Well, I managed that Linux and Eclipse use 1.5.0_10 fumbling the PATH variable in /etc/bash.bashrc. As Low hinted, that helped a lot, because Eclipse at least does not vanish anymore checkin out :). Trying to check out the trunk at once (10-15 times) yielded always in error. So I switched to check every package out. It seems to work (I am still drilling slowly my way down the different projects), but it is noticeable slower than Tortoise: checking out from the same LAN, Tortoise is actually The Hare ;-). We made the fabel The Tortoise and the Hare (Subclipse). While tortoise had downloaded all packets (400+ MB), Subclipse was struggling on its 6th project.
      Only with ".settings" I am having problems. I cannot check it out as a project. SVN asks me how I want to check it out. I imagine, the same problem will arise with the single files which are directly under "trunk" (.classpath xxxx and .project xxx.

      Summary
      The balance tilts  towards Windows XP for compiling. It is less cumbersome to get the sources (not to speak to start getting them!). For what I have read in the forum, Windows XP is the favorite tool to compile, and I can imagine why, red1. Let's see how it behaves compiling...
      It is only a paradox to compile on Windows XP for deployment on Linux, and apart from this forum, I won't say a word of it.

      Question
      As I really would like to test on the target environment (out of superstition, bad experiences in other projects?), can I copy the tortoise downloaded files and copy them to linux?

      So, thanks to all again, and I jump head on compiling.

      Mario
       

       
      • Colin Rooney

        Colin Rooney - 2007-02-27

        Mario

        I remember when I started I there were problems with the svn server https://svn.sourceforge.net/svnroot/adempiere
        It would constantly crash out but, as you mentioned, an update will usually ensure it restarted and continued on ok...
        It seems this was a Sourceforge server problems and they changed something in their server config. I know access via https://adempiere.svn.sourceforge.net/svnroot/adempiere
        and with this url teh checkout or update never hangs!

        colin

         
    • Mario Calderon

      Mario Calderon - 2007-03-07

      Hi,

      At last and thanks to the hints you gave me, I could check out the whole Adempiere trunk at once from SVN. Suddenly, it succeeded and now it succeds almost always. Tortoise as I said, works smoothly and quickly.

      Then, playing with Eclipse and poking in the sources, I discovered that I could run some build.xml files as "2 Ant build" and it seemed to produce some jar files. (Running them as "1 Ant build" produced errors).

      Then, I found in /utils_dev another build.xml with the promising "project name=adempiere" and run it again as "2 Ant build". To my joy, I saw in the console eclipse compiling, copying, deleting, building jars etc. In the end, it copied some zips and tars and told me "BUILD SUCCESSFUL".

      My questions:
      1.- Is this the correct way of compiling and building?
      2.- what does "1 Ant build" mean?
      3.- do I have to clean always first?
      4.- I see some files in /utils_dev. I suppose, with them I can do the cleaning, compiling and building outside eclipse. Am I right?
      5.- I see, in SVN/Eclipse I can only checkout the whole project, whereas in Tortoise I can update it. There is a way of updating the Adempiere sources in eclipse with SVN?

      Then I suppose I can start tomorrow changing the sources and create my "Hallo world".
      In the remote case I make some mistake and have to debug, do you have any hints I have to consider for debugging?

      Thanks for your support.

      Mario

       
      • Heng Sin

        Heng Sin - 2007-03-07

        hi mario,

        1. the build.xml in utils_dev is for building of release packages and create local deployment. When inside eclipse, you don't have to use the ant file, just use the build in Eclipse build project command. If you have auto build enabled, then it is just edit and run, no extra action needed.

        5. svn update equivalent is eclipse is team -> update or team -> synchronized. You can access the option by right clicking on the project folder when inside the java perspective.

        Regards,
        Low

         
    • pandjie

      pandjie - 2007-03-17

      I get no problem after creating adempiere development environment (version 3.1.4) in Eclipse. Just changing my java development environment.... and it works!!!!

       
    • Mario Calderon

      Mario Calderon - 2007-03-25

      Hi,

      First, the (very indeed) good news: with windows XP and Linux, I could start Adempiere 3.1.5 from Eclipse 3.2.2, set a breakpoint and stop the program at Adempiere.main(). So I have become a potential Adempiere developer! It is a long way, but I jumped this obstacle.

      I changed the Wiki ( http://www.adempiere.com/wiki/index.php/Create_your_ADempiere_development_environment ) with the tips you gave me and things I considered worthwhile for novices like me. If you give it a glance, correct errors and/or complete the documentation, it would be great.

      Funny enough, revisiting red1's documents, I noticed that his documents contain all information needed (thus: RTFM is true!). But, it is no waste to describe the same facts differently at different places.

      I have a little question

      On Linux Enterprise 10.1, Eclipse 3.2.2, I create a project:
      - I downloaded the whole trunk at once. AFAICS, everything's OK
      - when I create a new Eclipse project (file->new->project->java project), select "create project from existing source", and go to the Adempiere directory, I cannot ckeck the entries like "Adempiere/base/src", "Adempiere/client/src" etc. in the tab "order and export". I can move them up and down, but not check or uncheck them. On the other hand, all jar files like "activation.jar-Adempiere/tools/lib" are selectable. In XP, I could change the order and check the entries.
      - If I do not care, finish creating the project, I can run/debug Adempiere without errors ("build automatically" is set).
      - I expected to define the build order prior to running/debugging Adempiere. So I am very surprised it works in such a way.
      ---> Is everything working by coincidence or is it the way it should be?

      Tnnks and best regards,
      Mario

       
      • Colin Rooney

        Colin Rooney - 2007-03-26

        Mario,
        it all works because there are  .project & .classpath files in the trunk which do the setup.

        colin

         
    • Mario Calderon

      Mario Calderon - 2007-05-10

      Hello,

      Question 1
      I found out that when I select in Eclipse the file RUN_Build.sh of the dev_utils package, I can not read it though is it possible to execute it (run in Eclipse jargon). This way, I get the same results (at least, the same messages) as if I execute it in the console.

      Do both ways yield the same results? If not, what are the differences?

      Question 2
      When -I again in Eclipse- select the file build.xml of the dev_utils package, and run it with ANT, it seems also to build Adempiere, apparently without clean.
      Is it true? If not, what are the differences?

      Question 3
      What is the relation between RUN_Build.sh and buils.xml? There surely is one, but I do not see it.

      With the answers, I will update the Wiki section.

      Thanks
      Mario Calderón

       
      • Colin Rooney

        Colin Rooney - 2007-05-10

        Hi Mario

        Q1. Yeah by default it will try and run the script but you can right click and select "open with" and then "text editor" you shoudl be able to read and edit the file.

        Q2. Yes it does build without a clean .. I think this is intentional to speed up the  process.  By default Eclipse is continously compiling the project as you change code.  I did have a issue recently though when the project version changed... this resulted in multiple adempiere_31x.zip files (for the different versions) which was resulting in different versions deployed for the server than the client ... a manual clean resolved the issue.

        Q3. The build.xml is new to adempiere.  In the old Compiere method you would set create a myDevEnv.sh/bat and use the RUN_Build script ... but there were two files to maintain a .sh & .bat ... with a single build.xml ANT can be used on whatever system ... windows, linux, OS/X .... whatever!

        hope that helps some

        colin

         
    • Mario Calderon

      Mario Calderon - 2007-05-10

      Hi,

      thanks Colin for the swift answer.

      I added my interpretation of Colin's comments to the Wiki page "Create your ADempiere development environment", section "Compile ADempiere sources" ( http://www.adempiere.com/wiki/index.php/Create_your_ADempiere_development_environment ).

      If you give it a glance you might correct possible mistakes and complete the information.

      Best regards,
      Mario

       

Log in to post a comment.

MongoDB Logo MongoDB