Create your ADempiere development environment ja

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

環境の準備

以下をダウンロードし、インストールする

ADempiereのソースには、JDK 1.5 もしくはそれ以上のバージョンが必要。Eclipseのインストールディレクトリの"eclipse.ini"で、用いるjvmを指定できます。

  • Eclipse (Javaの開発にはEclipseが必要です。Windows版はeclipse-java-ganymede-SR2-win32.zip、Linux版はeclipse-java-ganymede-SR2-linux-gtk.tar.gz)
  • SubClipse (SVN)もしくはSubversive (SVN)を利用します。

Subclipse is an Eclipse add-on that enables you to access the Adempiere subversion repository (SVN) through eclipse. Subclipseは、Eclipse上でのアドオンで

Subclipse installation

1.- Automatic subclipse installation

In Eclipse Menu->Help/Software Updates/Find&Install. Select Subclipse.

2.- Manual installation

If automatic subclipse installation fails: download Subclipse installation file (e.g. site-1.2.0.zip). In Eclipse Menu->Help->Software Updates->Find&Install. Search for "New features to install", "New archived site". Select downloaded file (e.g. site-1.2.0.zip). (The Subclipse plugin for Eclipse can be found on http://subclipse.tigris.org. As of 12/02/07 latest version is site-1.2.4.zip) In the following dialog deactivate "Subclipse mylar integration".

Verification of correct Subclipse installation: Eclipse Menu ->Help->Software Updates->Manage Configuration. If you expand eclipse, you will see for example Subclipse 1.2.0.

These tools install differently depending on your Operating System. When provided information on these websites does not suffice, try to find help on the forums of your Operating System or unofficial forums about these tools.

For Oracle installation in Linux: read and follow carefully each step described in http://www.puschitz.com/InstallingOracle10gOnSUSE.shtml.


ADempiereのソースをダウンロード

1 Download ADempiere sources with Subclipse (for Linux and Windows)

First, you have to work in the "SVN Repository Exploring" perspective of Eclipse:

  • Open Eclipse
  • Eclipse menu->Window->Open Perspective->Other
  • Then select SVN Repository Exploring


Create a new Repository Location within the "SVN Repository Exploring" :

  • right mouse click on SVN Repository Exploring->New->Repository location
  • Type in the location URL: https://adempiere.svn.sourceforge.net/svnroot/adempiere. The Adempiere SVN Repository tree will be created
  • Open the Repository tree, select desired project and check it out using right click -> checkout...
  • Enter a new project name and click finish. If you enter an existing project name the existing project will be deleted before the files are checked out.


Updating with Subclipse

  • In Eclipse, select the java perspective and "Package Explorer" view (Eclipse menu -> Window -> View -> Package Explorer)
  • Select the Adempiere project
  • Right click -> team -> update or right click -> team -> Synchronize with Repository


2 Download ADempiere sources with Tortoise SVN (only for Windows)

  • Download and Install Tortoise SVN (http://tortoisesvn.net/downloads). Tortoise SVN is integrated with Windows explorer.
  • Create a directory e.g. C:\srcAdempiere\trunk
  • Open windows explorer and navigate to e.g. 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 starts checking out the trunk immediately. If the connection broke in the middle of checkout, you just right-click on trunk and select "SVN update" option


Updating with Tortoise SVN

  • Open a windows explorer and go to the project you want to update
  • Right click -> Tortoise SVN -> update to revision
  • If you want to update to the newest version, just press OK. Otherwise, you can enter the version you wanto to update to
  • You will find many convenient funtions with the Tortoise context menu - Right click ->Tortoise SVN


3 Checking out

There are two options:

  • Checking out Adempiere as a single project
  • Checking out the individual projects of the trunk one at a time

Either alternative will work, but each has its advantages and disadvantages:

  • Checking out the projects individually allows you to close unecessary projects in Eclipse which reduces memory usage. Using multiple projects allows you to use project dependency.
  • Checking out a single project is less time-consuming.

Choose whichever one you feel most comfortable with.


4 Creating the project "Adempiere" in Eclipse

  • Open Eclipse, java perspective, package explorer view
  • Eclipse menu->File->New->Project
  • In the following dialog, select "Java Project" and "Next"
  • Type in "Adempiere" as the Project name
  • Check the radio button "Create project from existing source"
  • Click the "Browse" button and go to the directory which contains the project you want to include (the directory has a file named ".project" )
  • Set the Build Path as specified in the next section
  • Click "Finish"


ADempiereソースのコンパイル

You can use Eclipse to compile and build ADempiere.

1 Compiling ADempiere

There are two directories for each compilable project (like base, dbport) in Adempiere trunk: a src directory and a build directory. They have the same structure within each project, differing only on the file suffixes: class for the build directory and java for the src directory. Compiling is the process of generating the .class files out of the .java files.

There are two ways for compiling:

  • Automatically: by default, Eclipse builds (i.e. compiles) automatically when changes occur. Project > Build is checked by default after Eclipse installation.
  • Manually: in desirable cases you may want to decide when to compile. Ensure Project > Build Automatically is not checked. You have to remember to manually compile with Eclipse before running ADempiere.


2 Building ADempiere

Is the process of archiving the class files into jar files and creating the installation files. Do not get confused with usage of the term "build". For Eclipse it means compiling the java files, whereas for ADempiere it is building the jar files.

There are three ways for building:

  • Via console: open a console, change directory to /adempiere_trunk/utils_dev and run RUN_build.sh. This script performs a clean before building. You see the messages on the console.
  • With Eclipse I: in the navigator view, expand utils_dev and select the file RUN_build.sh. Run it either via context menu (Run as > Run) or main menu (Run > Run). You see the messages on the console window of Eclipse. It behaves like running it from console.
  • With Eclipse II: in the navigator view, expand utils_dev and select the file build.xml. Run it via context menu (Run as > ANT Build). It is faster because it performs a build without clean.


3 Misc

(You may ignore this step as ADempiere contains .xml files for eclipse to process compile already. We reserved this information for reference. If you have interest, please glance.)

Although sources don't compile right away, nothing is really wrong with it. All you need to do is checking the Java Build Path and libraries of each project that doesn't compile. It happens these paths need an update before eclipse manages to compile it all.

To make things easier, follow this list in same order. This way you respect the project dependencies.

  • Tools
  • Looks
  • dbPort
  • Print
  • Base
  • serverRoot
  • Interfaces
  • Extend
  • Client
  • serverApps
  • Install
  • sqlj
  • webstore
  • doc

How to define Java Build Path:

- Select the java perspective, Package Explorer view

- Click Adempiere

- Right mouse click -> Properties

- Select Java Build Path, tab "Order and Export"

- Check above entries and arrange them in the described order

If you run into problems, probably org.compiere.util.CPreparedStatement won't compile. Resolve that by making sure you compile on Java 5.0 SDK and run the build script in trunk/utils_dev/RUN_build.sh|bat. If it doesn't work the first time, run the trunk/utils_dev/RUN_clean.sh|bat and build again.


ADempiereクライアントの実行

If developer is using multiple project Eclipse setup then in dbPort project there are two launch configurations crated for him. So he only need to start them!!

Running Adempiere through eclipse is simply a matter of creating a run configuration (Run -> Run... -> Java Application -> New) that points to the main method in dbPort/src/org.compiere/Adempiere.java.
(in eclipse3.3, Run -> Open Run Dialog...; under Java Application; if 'Adempiere' is not found, select 'New_configuration')

Fill the tabs with the following values as the minimum required values to have a new run configuration:
Tab 1:

  Name: adempiere_trunk (or whatever you wish)
  Project: adempiere_trunk (this has to be the name of the ADempiere project in Eclipse)
  Main class: org.compiere.Adempiere

Tab 2:

  VM Arguments: -Xms64m -Xmx64m (you may use less or more memory for ADempiere)

The VM Arguments define the minimum and maximum RAM allocation for Java VM. Ensure that you allocation enough RAM for ADempiere to run well in Eclipse. Similarly you can create a debug configuration to run Adempiere with hot code swapping to see your alterations as you work.


DBセットアップ

If you did not previously install Adempiere for end-users, you need a database. For its installation, follow the instructions in Getting Started.

Important: The database dump is found at data/seed/Adempiere[_pg].jar - simply unpack the file and import it into the db.


参考