使用eclipse 进行 Cesium 开发

接此;

https://blog.****.net/bcbobo21cn/article/details/109660784

在另一台电脑按此文搭建环境,失败;npm install 执行失败;

查了一些资料,运行 npm install -g npm 或 npm install gulp -g 均不能成功搭建环境;

看一下主要是要生成 node_modules 文件夹;网上下一个node_modules文件夹,拷过去看一下;原来node_modules文件夹各是各的,Cesium 有 Cesium 的,下面这个应该是VUE的;

使用eclipse 进行 Cesium 开发

看一下资料;原来可以用Eclipse开发Cesium;

Eclipse新建一个动态web工程;

使用eclipse 进行 Cesium 开发

添加tomcat;

使用eclipse 进行 Cesium 开发

 

使用eclipse 进行 Cesium 开发

新建动态web项目的配置;

使用eclipse 进行 Cesium 开发

添加项目成功如下;

使用eclipse 进行 Cesium 开发

然后把Cesium-1.75文件夹拷过去;拷到WebContent目录下;

使用eclipse 进行 Cesium 开发

可以直接使用拖放操作;把文件夹拖过去;

使用eclipse 进行 Cesium 开发

完成如下;

使用eclipse 进行 Cesium 开发

把项目布到tomcat7;

使用eclipse 进行 Cesium 开发

运行,出现 Server Tomcat v7.0 Server at localhost failed to start 错误;

使用eclipse 进行 Cesium 开发

看一下控制台显示的信息;

信息: Starting Servlet Engine: Apache Tomcat/7.0.11
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant
pool: 18
    at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:131)
    at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)

这是tomcat版本低;

 

再在eclipse里面配置一个tomcat8;完成如下;

使用eclipse 进行 Cesium 开发

启动tomcat8;

使用eclipse 进行 Cesium 开发

从下述菜单,打开eclipse内置浏览器;

使用eclipse 进行 Cesium 开发

1

使用eclipse 进行 Cesium 开发

访问如下网址;

http://localhost:8080/testce1/Cesium-1.75/Apps/HelloWorld.html

看一下Cesium自带helloworld例子跑起来了;

使用eclipse 进行 Cesium 开发

    然后可以进行下一步开发;