Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 

It's all about Java

I want to show you, how you create your own development environment for SAPUI5. You will see, that we are going to use some great tools, which are normally known from Java-Development. I will use Windows 7 as operating system.

Step 1: Install Java Development Kit (JDK)

The JDK is the Java package for developers, which includes a complete Java Runtime plus tools for developing, debugging and monitoring Java applications. You can download the latest version from this site. After the download has finished, run the installer.

Step 2: Set Up Environment Variables

After the installation of your JDK, it's important to create a new environment variable called JAVA_HOME. To do this, open your "Run" window in Windows and type in "control sysdm.cpl". On the Advanced tab, click Environment Variables. Then create a new System variable called JAVA_HOME. The value of this should be the path to your JDK.

After that, you have to add this variable to the existing PATH-Variable with %JAVA_HOME%;

Finally, when you open your command prompt, following command should work. "java -version"

This basic configuration is very important for Java-tools like your web server. To check your environment variables quickly, you can open your console and run the "SET" command, which displays all environment variables of your system.

Step 3: Install Eclipse

Go to this site and download the latest version of Eclipse IDE for Java EE Developers. Extract the zip-file to a directory of your choice (for example "C:\Program Files\eclipse"). When you start eclipse, you have to choose a workspace. This is a specific folder, where eclipse stores your projects.

Step 4: Install a Java Web Server

You will need a Java Web Server (also known as Servlet-Container), when you want to deploy and run your applications. I recommend the Apache Tomcat, but the Jetty Server for example is also a good option. Download the current tomcat from the download section of the official site. Extract all files in a directory, for example "C:\Program Files\apache tomcat". To test your configurations, go to the "bin" folder and try to run the startup batchfile to start server-mode. When everything is fine, you should see a window like this:

If your server has problems to start, you should check your environment variables (especially JAVA_HOME and PATH) and your java installation. You can shutdown your server with the "shutdown" batchfile.

Step 5: Add Web Server to Eclipse

If you want to deploy applications directly from your eclipse, you have create a new server instance in your IDE. Open Eclipse, go to "File - New - Others" and choose "Server". In the next window, choose Apache Tomcat (with correct version) as server type and type in following information:

After that, click finish. When you now open your Server-View ("Window - Show View - Server"), you should see your new instance. When you right-click on this entry, you can easily start and stop your server and do some configuration stuff.

Step 6: Install SAPUI5 Plugin

Go to your eclipse under "Help - Install New Software...". Paste one of the following URLs in the "Work with" input field, to get a list of available downloads options. You can find a list of all update-site URLs on the following site.

Select the entry "UI development toolkit for HTML5" and finish the wizard. Restart eclipse after you complete the installation. Then go to "File - New - Others" and type in the Wizard "SAP". You should see this (sry, for the german text):

When you choose "Application Project" and complete the wizard, you should have a basic SAPUI5-project and some initial files in your eclipse. The following picture shows the entry in the project explorer. If your project isn't displayed correctly in this view, you maybe have to change the "perspective" under "Window - Open Perspective - Java EE".

Step 7: Run your Project

Go to your new project and open in the directory "WebContent" the index.html. Then, click on the Run-Button:

In the following window, choose "Run on Server" and press "OK". The next window shows a listing of all available servers in your eclipse. In this case, we choose our tomcat server and activate the checkbox at the bottom. Click on finish.

You will see, that your web server will start and an the index.html will shown in a preview window. Congratulation! Now you can start to develop your application and test it on your local machine.

Some useful hints

1. Deployment and Tomcat Server Mode

When you want to present your application or run it in production, you can deploy your SAPUI5 app very easily on the tomcat server. When you don't use a build tool like ANT or MAVEN you have to export your project out of eclipse manually. Right-click on your project, choose "Export - War File". Provide the following form with some information like this:

After that, copy the war-File in the "webapps" directory of your apache tomcat. After a Restart (run "startup.bat"), you can now access your app under http://localhost:8080/<your_app>/.

2. Browsers

In SAP-Development, most projects are running on Internet Explorer. But for SAPUI5 - development, it's much better to use Chrome or Firefox(with firebug plugin), because both systems offer a great set of tools and plugins to debug your JavaScript, inspect your HTML, CSS and network activities and a lot of more cool stuff. Because Chrome is my favorite, you should have look at this site, where all details are explained perfectly.

I hope, all this information help you to get started with SAPUI5.

ENJOY!!!

95 Comments
ak_saparchitect
Explorer

Thanks Michael,

  Excellent blog on getting started with SAPUI5.Found the article very useful and helpful in establishing all the components and their connection.

Regards,

Aravindan K

Former Member

Thank you for your feedback! :smile:

Former Member

Great post Michael, and I love all the pictures.  I've been wanting to try out SAPUI5 for a while, now I have even more reason to.

Regarding browsers, wouldn't it be better to develop in IE since that's what most enterprise users will be using?  I'm not much of a web developer but all browsers offer javascript debugging, HTML/CSS inspection and the like.

Former Member

Love the step-by-step information to start with SAP new UI technology, most of the blogs generally provides overview on just the programming part but for starters like me would really be thankful to bloggers like you which gives the information on how to be prepared (with shields & armor ) before starting this new UI tech (this new war :wink: ).

Thanks again Michael.

Regards,
Shobhit Srivastava

Former Member

Good question! But to be honest, I think no serious web-developer use Internet Explorer as his primary platform to create web-applications. Other browsers like Chrome or Firefox offer appreciably more useful functions and enhancements than IE, especially when you are programming JavaScript. Here are some examples for Chrome:

  1. The usability, performance and documentation of chrome developer tools are much better than in IE. It's very simple and clear to inspect HTML, manipulate CSS or debug JavaScript.
  2. With Chrome's built-in Timeline you can monitor very precisely events, memory usage and other activities of your application.
  3. You can run audits to investigate the network utilization and web page performance. The result of this reports are recommendations, which describe, what you have to do to improve the performance and quality of your application.
  4. You can find in the official chrome web store a lot of great dev-tools, which enhance the build-in capabilities. Most of this tools are for free and very easy to install.

Of course, you can do a lot of these things in IE, too. But on condition that you are not a Microsoft fanboy, you will see that Firefox and Chrome are doing their job just better, if you compare these browsers.

When you are working with SAPUI5, the framework guarantees, that an application is running equivalently in all full supported browsers. Here is a list of this kind of platforms. I can recommend the following approach, which is something like a best practice in my team: Develop your applications primarily in Chrome, but test all milestones, components or deliverables in all target platforms within your development-process. To this day, we never had problems with IE9 and SAPUI5. (Our supported browsers are IE9, latest Chrome and FF, operating System is Windows 7).

Last but not least, SAPUI5 is build on jQuery. On benefit of this amazing framework is cross-browser support. So when you are programming with jQuery, the risk of browser issues are distinctly lower. The same applies to SAPUI5-Apps.

Former Member

Very thorough, thanks for the insight.  I'm moving to SAPUI5 from ABAP (and I suspect there are a lot of people doing the same) so the entire web development process is still new to me.  Not that HTML/CSS/JS are hard to learn, but it's a much different way of developing than most of us ABAPers are used to.  Thanks for the reminder about cross-browser support.

I look forward to using the Chrome Developer Tools!

magalhaes_christiano
Participant

Great blog Michael... very educational and objective.

Thank you.

Regards, Christiano.

Former Member

Very useful blog for a starter

Former Member

Thanks  Michael

The article is very helpful.
Former Member

Hi Cristian,

Your best bet would be to check out the official package sources of Ubuntu. I tested this configuration with 12.10:

1. OpenJDK 7(Runtime + Development Packages)

sudo apt-get install openjdk-7-jre icedtea-7-plugin (Runtime Packages)

...and...

sudo apt-get install openjdk-7-jdk openjdk-7-source openjdk-7-demo openjdk-7-doc openjdk-7-jre-headless openjdk-7-jre-lib (Development Packages)

2. Eclipse

sudo apt-get install eclipse

3. Tomcat

Setting environment variables:

  • export JAVA_HOME={path to JDK}
  • export PATH=$PATH:$JAVA_HOME/bin


sudo apt-get install tomcat7 tomcat7-admin

Installing SAPUI5-plugin and adding tomcat to eclipse should be the same like above.

Hope, that works!

abhijeetbhagat3
Explorer

Very good blog.. Unable to download the Eclipse IDE for Java EE Developers, yet though.. but surely will use this blog to set up the dev environment.

Former Member

Well, actually this should not be a link :smile: . But I added one now, so you get directly to the latest eclipse release (kepler). Thanks for your feeback!

JasonHinsperger
Product and Topic Expert
Product and Topic Expert

Thanks for the post. I found it very helpful.  It might be worth noting that only the SCN download contains the actual eclipse plugin - it is not available from the OpenUI5 site. Unfortunately, the SCN download is an older revision of the SDK.  Maybe it doesn't matter, but I found a more recent version of the eclipse tools (that matches the latest version of the SDK available on the OpenUI5 site) here:

SAP Development Tools for Eclipse

Former Member

That's great, Jason! Thanks for the sharing the link :smile:

Former Member

This is a really brilliant blog - thanks for putting it together in such a straight-forward but detailed manner.

Just one detail possibly worth adding, you need to use Tomcat 7.0, not 8.0, with Kepler if you want to use that as your runtime server as at the moment, Kepler doesn't seem to support Tomcat 8.0

Thanks,

Gareth.

rauf_shaikh
Active Participant

Tried downloading from the UI Development Toolkit for HTML5 download page(it says 278MB) but after 2 MB only download gets completedb and and ZIP gets downloaded partially.."it says unexpected end of line"

Former Member

Hi Rauf,

just have a look at this discussion, maybe it will help you further: Empty Archive

Regards Michael

JasonHinsperger
Product and Topic Expert
Product and Topic Expert

Rauf,

I find this happens to me when I am logged in to the SCN for a long time.  Usually, restarting my browser and/or logging out/in to SCN fixes the download problem.

midhun_vp
Active Contributor

Looks like nice trick, have to try it from next time.

Former Member

Nice Blog

Former Member

Very useful blog. I was trying to install SAPUI5 for a while.

Thank you,

Uday

Former Member

Very useful blog.

Former Member

Very useful, thank you

former_member210335
Discoverer

Useful one .... thanks

karthikeyan_rajagopalan
Product and Topic Expert
Product and Topic Expert

Thank you for the step by Step details.

i installed as described, but when  i create a new UI5 project i got the error

"One or more constraints have not been satisfied"

any idea?

thanks

Karthik

Former Member

Hi Karthik,

what version of Java and Eclipse are you using? In rare cases such problems can occur, if you have special software constellations.

Regards

Michael

karthikeyan_rajagopalan
Product and Topic Expert
Product and Topic Expert

Hello Michael,

I had Eclipse Kepler Package and JDK 1.8.

i just un installed JDK 1.8 and installed 1.7, and it works fine now.

In your screen shot it does show 1.7, but i just installed the 1.8 as that was the latest available.

I can create the project now without any errors.

thank you and Kind regards

Karthik

Former Member

Hi Karthik,

JDK 1.8 is just very recent, so problems in Eclipse and Eclipse-Plugins is nothing special.

But it's good to know, that JDK 1.8 is probably not compatible to Eclipse and UI5-Plugin right now.

Regards

Michael

Former Member

Thanks Michael :smile:

This Blog has been really useful. Especially with it's step by step picture-documentation for Beginner and Students like me...

best Regards

Alex

PS: SAP Press recently published a good book for the entry into SAP UI5

Einf&amp;uuml;hrung in SAPUI5. - Das Buch von SAP PRESS

le5lee
Explorer

Thanks for sharing!

matthias_b2
Participant

Thank you very much for the effort.

I have one problem with installing the SAPUI5 PlugIn (Step 6).

I downloaded the Open UI5 package, but when I try to install new software in Eclipse, it says "could not find file".

Adding the URL https://tools.hana.ondemand.com/kepler does not help either.


Any help is much appreciated.

best regards

Former Member

Hi Matthias,

can you please post a screenshot of your eclipse, when the error is appearing? I've never seen this message before...

Regards

Michael

matthias_b2
Participant

Hi Michael,

thank you for the prompt answer. This is what it looks like:

Best,

Matthias

Former Member

Well, there is no eclipse-plugin in the OpenUI5-SDK download-archive, so you have to install it over a update site URL. What happens when you enter the URL like in the following screenshot? You should actually see some download-options....

Former Member

Oh, it looks like SAP removed the original SAPUI5 evaluation package from the SCN. I will update the blog-post(especially chapter 6) in the next time. You definitely have to use the update-site URLs...

matthias_b2
Participant

Hi Michael,

it now works perfectly, thank you very much. Great job!

Best,

Matthias

Former Member

Excellent one to get started!

Former Member

Hi michael,

            thanks for the blog, I was able to install UI5.

         But i am getting error, while running the project. Below is the error.

Sep 03, 2014 6:03:40 PM org.apache.catalina.core.AprLifecycleListener init

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre7/bin/server;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/amd64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files (x86)\Microsoft Application Virtualization Client;c:\Program Files (x86)\Open Text\View\bin;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Broadcom\WHL\;C:\Program Files\Broadcom\WHL\syswow64;C:\Program Files\Broadcom\WHL\SysWow64\;C:\Program Files\Broadcom\WHL\SysWow64\syswow64;C:\Program Files (x86)\OpenText\Viewer\bin;C:\Program Files\Java\jdk1.7.0_67\%JAVA_HOME%\bin;;C:\Program Files\eclipse;;.

Sep 03, 2014 6:03:40 PM org.apache.tomcat.util.digester.SetPropertiesRule begin

WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:test' did not find a matching property.

Sep 03, 2014 6:03:40 PM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["http-bio-8080"]

Sep 03, 2014 6:03:40 PM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["ajp-bio-8009"]

Sep 03, 2014 6:03:40 PM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 691 ms

Sep 03, 2014 6:03:41 PM org.apache.catalina.core.StandardService startInternal

INFO: Starting service Catalina

Sep 03, 2014 6:03:41 PM org.apache.catalina.core.StandardEngine startInternal

INFO: Starting Servlet Engine: Apache Tomcat/7.0.55

Sep 03, 2014 6:03:41 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom

INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [174] milliseconds.

Sep 03, 2014 6:03:43 PM org.apache.coyote.AbstractProtocol start

INFO: Starting ProtocolHandler ["http-bio-8080"]

Sep 03, 2014 6:03:43 PM org.apache.coyote.AbstractProtocol start

INFO: Starting ProtocolHandler ["ajp-bio-8009"]

Sep 03, 2014 6:03:43 PM org.apache.catalina.startup.Catalina start

INFO: Server startup in 2480 ms

Sep 03, 2014 6:04:08 PM com.sap.ui5.resource.ResourceUtil loadProperties

WARNING: An error occured when accessing the /META-INF/ui5.properties! Reason: The /META-INF/ui5.properties could not be found!

Sep 03, 2014 6:04:08 PM com.sap.ui5.resource.ResourceServlet init

WARNING: Could not find property "x-sap-ui5-BuildTimestamp" in ui5.properties or MANIFEST.MF or the value is not valid! Using System.currentTimeMillis as cachebuster timestamp.

can you let me know what step I have done it wrong and how to correct it.

Thanks in advance.

Kishan Raj

Former Member

Hi Kishan,

good news, you have done nothing wrong. These warnings can be ignored, because they don't affect your development in any way. I discussed this issue some time ago: Eclipse +SAPUI5 Installation problem

The (Java-based) resource-handling functionality of UI5 just can't find the file ui5.properties in the META-INF folder of your web-application. This file is not created automatically by the wizard and it is not necessary to run an UI5-application. If you really want to avoid the mentioned warning, you can create this file manually with the property "x-sap-ui5-BuildTimestamp" (the value is a timestamp).

But you don't have to worry, i looks like you have done everything right!

Regards

Michael

Former Member

Hi Micheal,

            Thanks for your prompt response. :smile:

I have one more query. I am beginner. I want to learn UI5 from basics.

If you can give me some url, it would be great.

Thanks in advance,

Kishan Raj

Former Member

Hi Michael ,

     Useful blog.

Regards,

     Mj

Former Member
Former Member

Apart from official documentation (which is really good!), you can also check out this book: Getting Started with SAPUI5.

You will also find some tutorials about SAPUI5 and SAP Gateway (OData) in SCN. Just browse the blog post section in this space...

Former Member

Thanks Michael & Muni jagadish, I will check it out.

Former Member


Excellent blog Michael!

Thanks very much.

Ian

Former Member

Good post for creating workspace to the beginners learning UI5 .

Thanks for this beautiful post.

Former Member

Is it possible to work with orginal UI5 library locally ?

We have to find bug, at SAP instance ui5 library is in version 1.18.1. but we cant work in this envinronment, thats why i am looking how to download ui5 1.18.1 lo local computer.

Former Member

Hi Lukasz,

sry, i don't know, if there is something like a SAPUI5 archive, where you can pick your requested version. Maybe you should open a discussion for this issue in this space.

Regards

Michael

FabioPagoti
Active Contributor

This helped me quite a lot. I was able to install Tomcat on my Eclipse Luna running on Mavericks.

I just have one doubt: what should be my bootstrap if I want to use openui5 locally?

After downloading openui5 (SDK) using the link below I was able to easily locate 'resources' and folder 'sap-ui-core-all.js'.

OpenUI5 - Download

However copying this folder inside my project has two main issues

  1. The folder has 50MB and Eclipse just gets crazy when trying to deploy the project to Tomcat. I found heap memory issues and the deploy just takes too long.
  2. The SDK is not reused. I would like to reuse the SDK in many projects so copying and pasting inside each project doesn't seems the right way of doing that.

So I tried to use the local file directly in the bootstrap, as below.

    <script src="file:///Users/fabiopagoti/Dev/hana/openui5-sdk/resources/sap-ui-core-all.js"
   id="sap-ui-bootstrap"
   data-sap-ui-libs="sap.ui.commons"
   data-sap-ui-theme="sap_bluecrystal">
   </script>

However when I open my index.html file the is not located. I tried to copy and paste "resources" folder inside tomcat's folder but it has the same effect.

ReferenceError: sap is not defined
sap.ui.localResources("nyt-launchpad");

Could someone please help me sort that out?

Thanks!

Former Member

Hi Fabio,


i've seen, your question was being answered by an other user. I will link the thread here, so other interested parties can benefit from the conclusion of the discussion: How to load openui5 using the file system reusing 'resources' folder between projects?

Regards


Michael

Labels in this area