準備工作:
1、 安裝JDK 1.5或以上版本,設置好JAVA_HOME
2、 安裝MySQL 5.0或以上版本
3、 在http://www.eclipse.org/downloads/下載最新Eclipse版本,我下的是3.4.1版的Eclipse IDE for Java EE Developers,並解壓至工作目錄(我解壓至"C:\\",即工作目錄爲"C:\\eclipse")
4、 啓動Eclipse,通過點擊Help菜單中的Software Updates...啓動Software Updates嚮導界面,新建subclipse遠程站點,遠程下載地址爲http://subclipse.tigris.org/update_1.0.x,勾選下載安裝Subclipse Plugin後點擊Intasll按鈕安裝
檢出代碼:
1、 在新建…嚮導對話框中選擇從SVN中檢出項目
2、 在SVN檢出位置URL框中輸入:http://svn.apache.org/repos/asf/ofbiz後點擊Next。
3、 選擇文件夾"branches"release4.0後點擊Finish。
數據庫配置 [可以參考我寫的opentaps 1.0.2安裝(mysql)一文]:
1、 通過mysql命令行來創建obfiz運行所需數據庫,爲了方便識別,我們這裏就用ofbiz來做數據庫吧。
mysql> create database ofbiz;
mysql> exit
2、 編輯ofbiz目錄中的framework/entity/config/entityengine.xml文件,使其能正確連接到你的mysql數據庫中(注意其中的ofbiz-user與ofbiz-password,把它們改成你實際的數據庫連接用戶名與密碼)。
將其中的<delegator name="default"...> 段中的"datasource-name"從原來的"local" 改爲 "localmysql"
編輯<datasource name="localmysql"...> 段內容,修改"jdbc-uri"爲"jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true";修改"jdbc-username"/ "jdbc-password"爲你的mysql連接用戶名/密碼,修改character-set="gbk",collate="gbk_bin",示例如下:
<delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false"> <group-map group-name="org.ofbiz" datasource-name="localmysql"/> </delegator> <delegator name="default-no-eca" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" entity-eca-enabled="false" distributed-cache-clear-enabled="false"> <group-map group-name="org.ofbiz" datasource-name="localmysql"/> </delegator> <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main"> <group-map group-name="org.ofbiz" datasource-name="localmysql"/> </delegator> <delegator name="other" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main"> <group-map group-name="org.ofbiz" datasource-name="localmysql"/> </delegator>
<datasource name="localmysql" helper-class="org.ofbiz.entity.datasource.GenericHelperDAO" field-type-name="mysql" check-on-start="true" add-missing-on-start="true" check-pks-on-start="false" use-foreign-keys="true" join-style="ansi-no-parenthesis" alias-view-columns="false" drop-fk-use-foreign-key-keyword="true" table-type="InnoDB" character-set="gbk" collate="gbk_bin"> <read-data reader-name="seed"/> <read-data reader-name="demo"/> <read-data reader-name="ext"/> <inline-jdbc jdbc-driver="com.mysql.jdbc.Driver" jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true" jdbc-username="ofbiz-user" jdbc-password="ofbiz-password" isolation-level="ReadCommitted" pool-minsize="2" pool-maxsize="20"/>
3、 系統初始化
在命令行窗口下,進入ofbiz根目錄後運行
ant run-install
系統開始安裝,等大約15-30分鐘後,系統提示安裝完成。
啓動ofbiz:
有兩種方式可以啓動ofbiz:
1、 雙擊根目錄下的startofbiz.bat啓動
2、 在eclipse中用鼠標右鍵點擊build.xml,在右鍵菜單中選擇Run As->Ant Build…在彈出的構建對話框中targets選項卡中勾選run後點擊run
訪問ofbiz:
打開瀏覽器訪問:https://localhost:8443/webtools/control/main點擊屏幕右方的Login鏈接後進行登錄,登錄後就可以訪問你希望的功能特性,系統默認帳號爲admin/ofbiz,擁有所有權限。
本人原創文章,歡迎轉載,轉載請註明出處!