-
Notifications
You must be signed in to change notification settings - Fork 56
Getting started with Portofino 5
At the end of this tutorial, we'll have a running Portofino application connected to a SQL database.
Note n° 1: this tutorial is targeted at beginners. Experienced Java developers who use an IDE and Maven might still want to follow along with this, to quickly get a glimpse of what Portofino is about, but their development setup will be quite different. We'll cover that in other tutorials.
Note n° 2: most applications built with Portofino work by connecting to one or more relational databases. However, it's not a requirement. We can build a Portofino application with a NoSQL store or with no persistence at all, even if we'll miss out on some of its key features, in particular, the built-in persistence with Hibernate and the CRUD page. These, however, are out of the scope of this tutorial.
First, let's ensure that Java 8+ (JRE or JDK) is installed on our system. We can check it by typing at a command prompt:
java -version
We should get back something along the lines of:
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
Note that Java 8 is the minimum supported release, but it's quite old, and the long-term supported Java 11 is recommended.
First, let's download it from SourceForge.
We should have downloaded a file named portofino-5.1.0.zip. Note that 5.1.0 is the latest version at the time of writing, but a new version might be available now. Let's simply extract the archive to a place of our choice. It's better to avoid paths with spaces in them, if possible.
This is the layout of the extracted package:
It's a basic Apache Tomcat installation with the Portofino all-in-one webapp pre-installed and JDBC drivers for major open-source database systems available.
In order to connect to certain commercial database systems such as Oracle, we need to add the corresponding JDBC driver to the lib
directory of Tomcat. Each database vendor has their own drivers and licenses. If you have trouble connecting to a certain database or find that it's not supported by Portofino, please write to the mailing list.
Let's locate the file portofino-5.x.y/apache-tomcat-9.z/bin/startup.sh
(on Linux/OSX; on Windows, it's startup.bat
) and execute it by double-clicking on it.
Tomcat should start writing to the logfile portofino-5.x.y/apache-tomcat-9.z/logs/catalina.out
. We can make sure that Tomcat has started by looking for a line containing ... INFO [main] org.apache.catalina.startup.Catalina.start Server startup in ...
; however, it should take just a few seconds to start up.
We're still writing this document. In the meantime, you can continue over at the classic download page for Portofino 4, from "Point your browser" onwards. The steps are similar, even if the UI has changed.