解决从github下载web的源代码部署到eclipse的问题

2015年6月2日 天气晴
github官网:https://github.com/
以下以pdf.js作为案例说明:https://github.com/mozilla/pdf.js
1).点击案例站点右側的Download ZIP将源代码下载下来。并解压

注意:当然也能够通过HTTPS clone URL 及Clone in Desktop的方式把源代码下载下来,在此不做说明

2).在解压文件的web文件夹下找到viewer.html文件,把该文件又一次命名后缀为.jsp的文件。

注意:当然也能够通过查看在线demo的的源代码。并把demo源代码复制到相应的jsp文件就可以

3). 按部就班的把js、css文件整合到web项目中

注意:方便起见,最好分别建一个js、css分别用来放js及css文件

4).执行eclipse中的项目,重复结合谷歌chrome的控制台console查看报错问题。并进行解决,直到所有错误消失为止

另外,上传者也提供了一种比較好的方式来获得代码,以下简单说一下

1).To get a local copy of the current code, clone it using git:

$ git clone git://github.com/mozilla/pdf.js.git
$ cd pdf.js

注意:Git for Windows下载地址:http://msysgit.github.io/,直接安装就可以

2).Next, install Node.js via the official package or via nvm. If everything worked out, run

$ npm install

to install all dependencies for PDF.js.

注意:nodejs下载官网为:http://nodejs.org/。打不开的情况下能够FQ或者时用其它站点替代。对安装有问题,能够參考一下W3CSCHOOL.CC这个网址;对nodejs不了解,能够查看一下百度百科

3).Finally you need to start a local web server as some browsers do not allow opening PDF files using a file:// URL. Run

$ node make server

4).and then you can open

http://localhost:8888/web/viewer.html
It is also possible to view all test PDF files on the right side by opening

http://localhost:8888/test/pdfs/?frame
注意:找不到pdf.js这个文件夹的时候。能够通过EveryThing这个软件进行搜索。EveryThing下载地址为:http://www.voidtools.com/

posted @ 2016-02-06 15:47  blfshiye  阅读(287)  评论(0编辑  收藏  举报