SAPUI5: https://sapui5.hana.ondemand.com
大致分为以下几步:
- Java JDK 下载和安装(这里是jdk1.8)
- Eclipse 下载和安装
- 部署Tomcat http://tomcat.apache.org/
- 安装 SAP Development Tools for Eclips
- 搭建eclipse开发环境
1.Java JDK 下载和安装,配置JDK开发环境(安装的时候自己把jdk,jre分开记清楚)
1.1依赖 (PATH: JDK需要配到bin目录下)
1.2运行环境: (Class Path : 配到rt.jar;.)
1.3 到这里JDK算配置完成,打开cmd测试一下jdk环境(java)(javac)(java -version)
显示出这样的就没问题
2.下载,部署Tomcat
如遇到以上问题,在conf目录下修改对应ports 再重启试试
如还不行 查看对应端口被什么程序占用了,干掉它,再重启,还是cmd
如网页上还不行, 就不知道了
3. 安装 SAP Development Tools for Eclips
3.1打开eclipse, hlep->install new Software
等着完成就行了(貌似巨慢.....)如果站点不对,这是一些站点,换一个试试(或者自己去看看版本:https://tools.hana.ondemand.com/)
Eclipse软件站点
要安装某些或所有Eclipse工具,请进行与所需工具兼容的安装,并使用“ 帮助”>“安装新软件”向导中的相应软件站点URL 。根据您的日食版本:
- 对于Eclipse 2019-12(4.14),请使用https://tools.hana.ondemand.com/2019-12
- 对于Eclipse 2019-09(4.13),请使用https://tools.hana.ondemand.com/2019-09
- 对于Eclipse Oxygen(4.7),请使用https://tools.hana.ondemand.com/oxygen
4. 到此一切就绪了 ,来试试“hello world” .
4.1首先打开下载好的eclipse把配置好的jdk和tomcat一并导进来(Windows->Prefrences),
4.2接下来新建第一个项目
4.2 在WebContent下新建一个index.html文件,然后拷走以下代码
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>SAPUI5 in 20 Seconds</title>
<!-- 1.) Load SAPUI5 (from a remote server), select theme and control library -->
<script id="sap-ui-bootstrap"
src="./sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.ui.commons">
</script>
<!-- 2.) Create a UI5 button and place it onto the page -->
<script>
// create the button instance
var myButton = new sap.ui.commons.Button("btn");
// set properties, e.g. the text (there is also a shorter way of setting several properties)
myButton.setText("Hello World!");
myButton.placeAt("mybtn");
// an alternative, more jQuery-like notation for the same is:
</script>
</head>
<body class="sapUiBody">
<div id="mybtn"></div>
</body>
</html>
完了之后,部署到tomcat上面,打开浏览器输入项目地址运行(http://localhost:8080//TESTSAPUI5//index.html)
运行结果: