Building ReplicatorG With Eclipse

1、安裝相關Java相關運行環境html

一、jdk-6u45-windows-i586.exejava

二、jre-6u45-windows-i586.exelinux

直接安裝便可。環境變量配置:git

以安裝位置D:\Dev\Java\jdk1.6.0_45爲例:github

JAVA_HOME=D:\Dev\Java\jdk1.6.0_45macos

PATH=%JAVA_HOME%\binapache

2、安裝Antwindows

解壓到指定位置便可,環境變量配置:oracle

以安裝位置D:\Dev\apache-ant-1.9.4爲例:app

ANT_HOME=D:\Dev\apache-ant-1.9.4

PATH=%ANT_HOME%\bin

3、安裝Eclipse

直接安裝便可,第一次打開Eclipse須要指定工做目錄,如:D:\Dev

4、下載ReplicatorG

將下載的ReplicatorG-master.zip解壓到Eclipse工做目錄,目錄結構爲:

D:\Dev\ReplicatorG

D:\Dev\ReplicatorG\build.xml

5、將ReplicatorG導入Eclipse並配置ReplicatorG環境

  • Start Eclipse and select "File>New>Project…" from the menu. Select "Java Project from Ant Buildfile" from the wizard.
  • Select the "build.xml" file from the ReplicatorG directory as the Ant buildfile. Click "finish" to create the project.
  • All the additional libraries needed for build were automatically added by Ant but they should be manually re included from within "ReplicatorG/build" directory:
    • Right click on the project name, and select "Properties".
    • In the Properties dialog, select "Java Build Path".
    • Select the Libraries tab.
    • Press "Add External JARs…" (on the right side of the window).
    • Add all the JARs from within "build/shared/lib" directory.
    • Optional: Remove all the duplicated JARs.

If you intend to run ReplicatorG from Eclipse, you'll need to set up a launch configuration. When you do, be sure to add the native libraries for your platform to the VM arguments.

  • Still in the properties dialog, select "Run/Debug Settings". Click "New", then "Java Application". This will bring up the edit configuration dialog.
  • On the main tab, for a main class select "Base - replicatorg.app"
  • On the Arguments tab, add the library paths to the VM arguments.
    • For a Linux x86 build (tested on Linux Ubuntu 11.10), add: -ea -Djava.library.path=${workspace_loc:ReplicatorG}/build/linux/dist/lib-i686 -Dreplicatorg.app-resources=${workspace_loc:ReplicatorG}/build/shared/lib -Djava.library.path=/usr/lib/jni
    • For a Linux x86-64 build (tested on Linux Ubuntu 11.10), add: -ea -Djava.library.path=${workspace_loc:ReplicatorG}/build/linux/dist/lib-x86_64 -Dreplicatorg.app-resources=${workspace_loc:ReplicatorG}/build/shared/lib -Djava.library.path=/usr/lib/jni
    • For a Windows build, add: -ea -Djava.library.path=${workspace_loc:ReplicatorG}/build/windows/dist -Dreplicatorg.app-resources=${workspace_loc:ReplicatorG}/build/shared/lib
    • For an OS X build, add: -d32 -ea -Xmx1G -Djava.library.path=${workspace_loc:ReplicatorG}/build/macosx/dist -Dreplicatorg.app-resources=${workspace_loc:ReplicatorG}/build/shared/lib

翻譯:

  • 啓動Eclipse後選擇菜單"File>New>Project…" . 從彈出的菜單選擇"Java Project from Ant Buildfile".
  • 指定Ant buildfile爲從ReplicatorG目錄下的"build.xml" 文件. 點擊"finish" 按鈕建立項目.
  • All the additional libraries needed for build were automatically added by Ant but they should be manually re included from within "ReplicatorG/build" directory:
    • 右擊項目名稱, 並選擇"Properties".
    • 在「Properties」對話框中, 選擇"Java Build Path".
    • 選擇Libraries頁面.
    • 點擊"Add External JARs…"按鈕.
    • 從 "build/shared/lib" 目錄添加全部JAR後綴的文件.
    • 若是有重複的文件則刪除.

If you intend to run ReplicatorG from Eclipse, you'll need to set up a launch configuration. When you do, be sure to add the native libraries for your platform to the VM arguments.

  • 仍然在「Properties」對話框中, 選擇"Run/Debug Settings". 點擊"New", 而後選擇"Java Application". 將打開「Edit Configuration」對話框.
  • 在 main 頁面, 指定main class 爲:"Base - replicatorg.app"
  • 在 Arguments 頁面, 添加庫路徑到VM arguments.
    • For a Linux x86 build (tested on Linux Ubuntu 11.10), add: -ea -Djava.library.path=${workspace_loc:ReplicatorG}/build/linux/dist/lib-i686 -Dreplicatorg.app-resources=${workspace_loc:ReplicatorG}/build/shared/lib -Djava.library.path=/usr/lib/jni
    • For a Linux x86-64 build (tested on Linux Ubuntu 11.10), add: -ea -Djava.library.path=${workspace_loc:ReplicatorG}/build/linux/dist/lib-x86_64 -Dreplicatorg.app-resources=${workspace_loc:ReplicatorG}/build/shared/lib -Djava.library.path=/usr/lib/jni
    • For a Windows build, add: -ea -Djava.library.path=${workspace_loc:ReplicatorG}/build/windows/dist -Dreplicatorg.app-resources=${workspace_loc:ReplicatorG}/build/shared/lib
    • For an OS X build, add: -d32 -ea -Xmx1G -Djava.library.path=${workspace_loc:ReplicatorG}/build/macosx/dist -Dreplicatorg.app-resources=${workspace_loc:ReplicatorG}/build/shared/lib

右擊「build.xml」文件,在彈出的快捷菜單中點擊「Run As」->」External Tools Configurations…」

在彈出的Edit Configuration」對話框中勾選「Targets」頁面的「Run」、「debug」、「dits-windows」項:

右擊「build.xml」文件,在彈出的快捷菜單中點擊「Run As」->「1 Ant Build」構建項目

相關文章
相關標籤/搜索