Import ardublock to Eclipse

Tools

You need tools below to import ardublock source code to Eclipse.

  1. Git tools
  2. Eclipse
  3. Maven
    • We use maven to manage java packages.
  4. M2Eclipse
    • I am very to recommend you install a maven plugin, if you develop openblocks. it will help you raising development efficiency.
    • instll-m2e

Prepare The code

First, you need to clone the source code from github. Ardublock is depended on Openblocks. You can find these two repo here

https://github.com/heqichen/ardublock.git
https://github.com/heqichen/openblocks.git

you will find the git clone url on the right or page.
then you need to clone this two repos.  for example ardublock clone url is https://github.com/heqichen/ardublock.git and openblocks clone url is https://github.com/heqichen/openblocks.git

now open your terminal, and go to your development directory. For example, my development directory is ~/ardublock/

you will get something like this.

Cloning into ‘openblocks’…
remote: Counting objects: 2166, done.
remote: Total 2166 (delta 0), reused 0 (delta 0), pack-reused 2166
Receiving objects: 100% (2166/2166), 4.20 MiB | 6.00 KiB/s, done.
Resolving deltas: 100% (863/863), done.
Checking connectivity… done.

git-clone

and same as ardublock project. Finally got two repo in your local machine.

git-folder

Import to Eclispe

Now Lets import the source code.

After these commands, Maven will download the required packages and make eclipse project.
now we can import ardublock into elicpse
open eclipse
File -> Import -> Gernal -> Existing Projects into Workspace

eclipse-inport

you may find some error, because of missing openblocks package.

06-ardublock-error1

07-ardublock-error2

there are two method to resolve this problem.

1. install the openblocks package locally.

go to openblocks folder and run

After these command, maven will compile and install openblocks package in your local machine.

08

Now, no error any more.

09-ok

Another method is import openblocks in your eclipse.

run command as ardublock and import openblocks into your eclipse. Also can solve the problem.

10-ok2

42,321 total views, 3 views today

15 thoughts on “Import ardublock to Eclipse

  1. 很详细的教程!

    截图中使用的是 1.0.2,但是 ardublock 依赖的是 1.0.3,如何解决呢?

    eclipse 报错:
    library: ‘E:\maven_repository\edu\mit\openblocks\1.0.3-SNAPSHOT\openblocks-1.0.3-SNAPSHOT.jar’ ardublock

    • 已解决。但是又有新的问题,就是 mvn install 出来的 jar 无法正常运行(但是 eclipse 里面可以运行 main):
      C:\Users\Lee>java -jar C:\Users\Lee\Downloads\ardublock-master\target\ardublock-all.jar
      Exception in thread “main” java.util.MissingResourceException: Can’t find resource for bundle java.util.PropertyResourceBundle, key bg.xxx_Button_Module
      at java.util.ResourceBundle.getObject(Unknown Source)
      at java.util.ResourceBundle.getString(Unknown Source)
      at edu.mit.blocks.controller.WorkspaceController.ardublockLocalize(WorkspaceController.java:223)
      at edu.mit.blocks.controller.WorkspaceController.setLangDefStream(WorkspaceController.java:173)
      at com.ardublock.Context.resetWorksapce(Context.java:142)
      at com.ardublock.Context.(Context.java:95)
      at com.ardublock.Main.startOpenblocksFrame(Main.java:34)
      at com.ardublock.Main.startArdublock(Main.java:28)
      at com.ardublock.Main.main(Main.java:23)

    • 我修改过openblocks的版本,因为openblocks里面bug太多了,我不断在修bug,但还没有把正在开发的版本放上来,如果出问题的话,自己修改一下版本,统一一下就可以了

    • I’m excited about ArduBlock as it’s been helpful teaching programming to elementary-aged kids.

      I also appreciate this tutorial, yet I got stuck at the same error: [Project ‘ardublock’ is missing required library: ‘C:\Users\JasonWChan\.m2\repository\edu\mit\openblocks\1.0.3-SNAPSHOT\openblocks-1.0.3-SNAPSHOT.jar’].

      How was it solved? Does it matter which Java version we use also? I’m using Java 1.80_60 with Eclipse Mars.1 Release (4.5.1) with Windows 7.

      Thanks so much in advance :) Jason

      Sorry, I can only understand English, so I had to use Google-Translator to understand the Chinese. :)

Leave a comment