天天看點

開源3D列印軟體ReplicatorG的源代碼的擷取與配置 Prerequisites Creating the project yourself

由于ReplicatorG的開源項目好像沒有人維護了,是以其源代碼下載下傳下來需要一些變化才能運作,我是用Eclipse運作的,系統是win7 64位。

1 源代碼的擷取

由于他們是在GitHub上維護的,是以他們給出的網址是:https://github.com/makerbot/ReplicatorG 如下圖所示,他們最晚的維護的時間是2013年4月,是以代碼有可能出問題。右下角是下載下傳的連接配接,如果有git可以直接利用git克隆過來,如果沒有直接下載下傳ZIP檔案也是可以的,當然他是國外的網站,是以我把我下載下傳的ZIP檔案分享出來:

源代碼連結:http://pan.baidu.com/s/1pJ64niV 安裝檔案(我安裝不成功)連結:http://pan.baidu.com/s/1c0i4gVY

開源3D列印軟體ReplicatorG的源代碼的擷取與配置 Prerequisites Creating the project yourself

2 源代碼的建構

對于怎樣建構這個程式其官網也有介紹,官網網址:http://replicat.org/building-from-source,其介紹是先下載下傳--再裝Git--再裝JDK(這個是必須的)--在裝Ant等等,但是如果我們使用Eclipse進行建構的話,這些就都省了,因為JDK當然我們已經裝好了,其中Eclipse中就内置Ant,是以就不用裝了。對于怎樣在Eclipse中建構,官網上時這麼介紹的。額,确實他都說出來了。翻譯就……有時間的時候我再翻譯吧。

Prerequisites

Make sure you've installed the sources and tools as described on our building from source page, and that you've correctly installed the Eclipse IDE.

Creating the project yourself

  • 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

但是對于WIN7 64位,按照他這麼搞還是不行,需要這些東西:

Windows 7 64-bit builds

Mark Klunder recommends the following to get Eclipse builds working properly on 64-bit Windows 7 platforms:

To get ReplicatorG to execute on my Windows7 64bit edition under jdk 1.6.0_26 i had to do the following

Removed : JRE_Lib 
Added :   JRE System Library [jdk1.6.0_26]

Changed files to 64 bit versions 
-------------------------------------------------------------------------------------------
j3dcore-ogl.dll      :  Sourced from http://java3d.java.net/binary-builds.html
rxtxSerial.dll        :  Sourced from http://www.cloudhopper.com/opensource/rxtx/
RXTXcomm.jar     :  Sourced from http://www.cloudhopper.com/opensource/rxtx/           

We'll try to get these libraries into the source tree soon.

他雖然說會很快将這些庫添加到資源裡,但是,你懂得……,注意上面的連接配接都是不能用的,要下載下傳,我給出我上傳到CSDN上的連結:

rxtxSerial.dll和                RXTXcomm.jar 的連結為:http://download.csdn.net/detail/xuanyuanlei1020/8866785      

上面tool的安裝方法都是lib中的檔案放到JDK-->JRE-->lib-->ex中,bin中的檔案放到JDK-->JRE-->lbin中,當然我們可以通過檔案自身含有的安裝方法進行安裝(一般都是readme)。 當然,他的上面的那一句話,還是要聽的,就是,将JRE_Lib删掉,然後使用自己的JDK(不必是1.6,我使用就是1.8)。

做了這麼多夠了嗎,額不夠還……,我們按照他的方法,導入Eclipse中發現代碼中有錯誤,就是對于compare類的錯誤,這個時候我們需要這樣做:

Windows-->preference-->java-->compiler中将他的1.5 改為1.7(我是用的JDK 1.8,是以……)。

3 對一些資源進行移動

因為使用Eclipse進行調試,有些資源需要進行移動(他們是利用Ant和xml檔案直接将資源打包在Jar中,是以有些目錄是不對的)。具體移動方式晚上再添加。

好了做了這麼多應該就可調試出來,如果還有什麼問題,可以給我留言。