One of the fun parts of my job as a mobile and development tools product manager, is I'm often given the chance to learn new technologies, without necessarily the pressure of rushing to deliver a project and therefore also rushing learning the technology superficially.
Rather than keep all these useful "learnings" in my head, this time, I thought I'd take pen to virtual paper and describe what I learned along the way, with the goal of sharing this with communities like DZone to help others get started.
So in starting out, in this article I'll focus on the basics of installing Oracle JET for web development which is where everyone, including myself, has to start. Assuming the editors appreciate my efforts and Australian grammer isn't too horrible, I hope to expand this into a series of articles for others to learn from.
What is Oracle JET?
Before discussing how to install the Oracle JET tooling, for anyone not familiar with Oracle JET let's take a quick recap.
If you'd like to learn more about Oracle JET before continuing on take the chance to visit oraclejet.org for more information. If you'd like to see a JET app in action, check out the demo Work Better app.
How to Install Oracle JET for Web Development
In developing pure web applications (I hope to cover hybrid-mobile apps in another article) using Oracle JET, JET uses several well-known & popular Open Source packages:
- NodeJS's Node Package Manager – used to install the other developer packages
- Git – in conjunction with Github provides access to the source for the other packages
- Yeoman – a web application scaffold tool for creating the shell of each JET app
- Grunt – akin to make files of old, used to run tasks to build and run JET apps
- Bower – separate to npm designed to download front-end runtime artefacts
- Oracle JET – the JET tooling and runtime that uses ND extends the other tooling
I'd like to say it's nearly possible to install all of these in 1 command line, but, Git and npm (contained in NodeJS) which must be installed first require a few more steps. Depending if your development machine is running Windows, MacOS or Linux, you need to download & install a specific installation package for your operating system for both of these. Luckily both Git and NodeJS/npm's website and install instructions are fairly straightforward. It's worth noting for developers not familiar with npm it is installed as part of NodeJS.
Tip: For anyone using Linux, be careful in installing NodeJS/npm using sudo. I'm no Linux expert but this did cause me a world of privilege-grief when I made this mistake. Consider using Node Version Manager (nvm) to manage your NodeJS installs instead.
Having installed Git AND npm, via the command line you can then install the rest of the packages in one line using npm. For reference 'yo' refers to Yeoman.npm:
npm install -g yo grunt-cli bower generator-oraclejet
At conclusion to check what was installed and what versions, you can issue the following npm command:
npm list -g --depth=0
An example result from my Mac:
/usr/local/lib ├── firstname.lastname@example.org ├── email@example.com ├── firstname.lastname@example.org ├── email@example.com ├── firstname.lastname@example.org └── email@example.com
(Note the generator-oraclejet version 1.1.0 does currently not relate to the Oracle JET version (the latest being v2.1), but the version of the template generator & associated Yeoman templates for JET. This will be resolved in a future version of Oracle JET)
In concluding the install you can test the setup by creating a JET application from a supplied Yeoman template and running it. Oracle JET comes with several templates, that essentially create a preconfigured shell for your web application. We'll use the 'navbar' template which will create a Single Page Application (SPA) with several tabs accessing modules such as a dashboard, incidents and customers which is designed to give you a footprint for building your own apps:
yo oraclejet MyWebProject --template=navbar
Tip: If you're on a slow internet connection ensure to be patient and check the process finishes successfully without timing out.
Once the process completes successfully we can then build and serve the application on our development machine via Grunt:
cd MyWebProject grunt build grunt serve
And after a second or so you should see the running app built upon the template "navbar" shell in your default browser:
At this point you're right to continue learning about and developing your Oracle JET web application. If you're new to Oracle's JET I highly recommend hitting the Oracle JET homepage which includes links to the documentation, tutorials, videos, demo applications and a detailed cookbook.
Overall, installing the tooling for Oracle JET is relatively painless and a good way to get started with JET to learn the foundations and start exposing yourself to what collateral is available to assist you.
In a follow-up article, I hope to publish how to install the tooling for hybrid-mobile applications with Oracle JET, where it's a little more complex thanks to having to install things like the Android SDK, Xcode and more.
Overall I hope this was helpful, stay tuned for more.