在Eclipse中运行pdfbox

【前言】pdfbox是实验室做文档识别需要了解的开源项目,可是官网doc过于简略,网上资料很多只是调用jar并非在Eclipse中配置运行源代码,仅以此文祭奠我两天的折腾时间……

0) Environment Specification
OS:Windows 7
IDE:Eclipse SDK 3.7.0
JDK:Version 6 Update 26

1) This post will not involve the configuration of Java, but you need to confirm JAVA_HOME is in your “Environment Variable” which we will need later on.
The key should be “JAVA_HOME” and the value is the path of JDK, for me is “D:\Program Files\Java\jdk1.6.0_26″

2) Download and extract pdfbox, pdfbox-*.*.*-src.zip, for me is “pdfbox-1.6.0-src.zip” and the extact location is “E:\Code\JAVA\pdfbox-1.6.0″
http://pdfbox.apache.org/download.html

3) Download and Extract Maven2, apache-maven-*.*.*-bin.zip, for me is “apache-maven-3.0.3-bin.zip” and the extract location is “D:\Program Files\apache-maven-3.0.3″
http://maven.apache.org/download.html

4) Configure the “Environment Variable” for Maven2 / Install Maven2
4.1) Add key “M2_HOME” and the value is path you extact Maven2, for me is “D:\Program iles\apache-maven-3.0.3″
4.2) Add “%M2_HOME%\bin” to the key “Path”.
4.3) Open a new command prompt and run “mvn –version” to verify correct installation.

5) Install and configure the pdfbox via Maven2
5.1) Open a new command prompt and change directory to the extract location of pdfbox
5.2) Run “mvn clean install” to install the pdfbox
5.3) Run “mvn eclipse:eclipse” to make it a eclipse project.
5.4) Run “mvn -Declipse.workspace=”PATH OF THE WORKSPACE” eclipse:configure-workspace” to add M2_REPO classpath variable to Eclipse.
Note : 5.3 & 5.4 is the MOST IMPORTANT part.

6) Import the project into Eclipse with the root directory of pdfbox (for me is E:\Code\JAVA\pdfbox-1.6.0) then there should be no errors in all the projects.

7) Edit the “Run Configurations” and enter the command line arguments in the “Arguments” tab and then everything should run correctly.

Reference:
1) http://pdfbox.apache.org/userguide/building_pdfbox.html
2) http://maven.apache.org/download.html#Installation
3) http://maven.apache.org/guides/getting-started/index.html
4) http://www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/

大三了……

好久没发日志了,Calendar排的满满的,忙碌的学期就这样开始了……

1、ICST:实习机会很宝贵,想好好珍惜的,难得老师赏识,我也想踏踏实实真正做点东西

2、必修课:虽然实验室导师给予了保研的承诺,但还是以我有保研资格为前提的,这学期好多理论课,要努力静下心好好学学

3、Google Camp:说实话,现在对社团越来越迷惘了,或许我总是避免不了理想主义的禁锢,到头来总让自己不是滋味,决定逐渐放下了。小白,你要加油!

4、奶奶:苦了一辈子的老人家,到头来还要经受病痛的折磨。异地求学让陪伴都变成了奢望,然而回去又会陷入无能为力的哀伤,真不知道该怎样才好……

5、爸爸妈妈:如果世界上没有钱这种东西,一定会少了很多烦恼。你们辛苦了,你们要好好的,钱根本没有你们重要……

6、小狗:笨笨知道,你一个人更不容易。笨笨真的想可以和你能有结果,但是无论怎样,你一定要幸福……不然我不会饶了你!

夜深了,最近其实效率挺低的,还是有点心浮气躁吧,回去休息了,新的一天已经开始了……

准备入手:Twitter抱枕

又现水文一篇,欢迎各种无视~

现在每天中午基本都要呆在实验室(懒的来回跑了,而且更杯具的是,昨天在北大和同学打篮球,脚扭了……求各种安慰……)

现在在ICST的条件虽然很好,但也确实没有适合睡觉休息的地方(想念405和306的沙发床……)

其实很早就开始觊觎GeekCook的各种创意小玩意了,这次也是第一次入手,抱枕中有一个Android的也非常喜欢,可惜没货了,而且比相同规格的其他产品贵,不知道是什么原因。退而求其次,选择了这个Twitter的抱枕,其实有一款Twitter的围巾更诱惑我,我在处心积虑准备找一个邪恶的理由用它把小狗裹着~

上图一张,好期待啊~
抱枕Twitter

My Life in ICST

水文一篇,发几张照片,闲杂人等请自行忽略~
一来避免老爸又抱怨我发的日志他都看不懂
二来考虑到这里进门都要刷卡,万一滚O了就没机会了~
不准嘲笑本人冲话费送手机换来的200W像素摄像头,各种模糊请自行忽略
P.S. ICST 全称 Institution of Computer Science and Technology of Peking University
(北京大学计算机科学技术研究所)详情见街旁链接


1、有亮点,自己发现~
有亮点

2、节约用扈煊
节约用扈煊

3、节约用扈煊——原版
“节约用扈煊”原版~

4、Google苹果~
Google的苹果!

5、最后来个全景,继续亮点~
取个全景