For developing packaged applications in GJS we highly recommend GNOME Builderopen in new window. GNOME Builder can download the latest GJS version for you and provides support for developing secure, structured GNOME applications.
If you do not have GNOME Builder installed you can get it hereopen in new window.
Using GNOME Builder
Creating a New GJS GTK Application Project
First open GNOME Builder and select
New... to create a new project.
GNOME Application so GNOME Builder correctly configures and creates a template for you to build your first project from.
Configuring the Runtime Environment
Go to build settings.
In your application ensure that the runtime environment is set to Gnome Platform 3.28 or higher.
Working in Other IDES
If you are working in another IDE it is possible but more complicated.
Download the Template
First, download the application template (or use
git clone [link])
Install GJS from any of the packages below.
- Ubuntu 18.04open in new window
- Fedora 28open in new window
- Debianopen in new window Warning: Out of Date In Stretch
- Arch Linuxopen in new window
- more at pkgs.orgopen in new window
Verifying Your GJS Version
Verify your system has a recent version of GJS. Type...
Building Your Project
To build your project open a terminal in your project's root directory and type the following...
...to initialize Meson. Now type...
mkdir build && cd build && ninja && ninja build
Running Your Project