Chromebooks
Learn how to code with BoxLang and your favorite Chromebook!
We love Chromebooks, so this guide is for those who want to run and develop BoxLang applications using Intel-based or ARM-based Chromebooks. We will install all the prerequisites, BoxLang, and VSCode to use the BoxLang IDE and create our first application.
Requirements
4GB RAM Chromebook minimum
Linux Developer Environment
JDK 21+
Linux Environment
Chromebooks are great as they allow you to install a Debian Linux container alongside your OS. You can do so easily by opening Settings > Advanced > Developers
and installing the Linux environment. Go through the wizard, and voila! Debian Linux will be installed alongside your Chrome OS.
Terminal
You will be interacting with the Linux installation via the Terminal application.
Once you open the terminal, you can click on the Penguin
tab, and it will open the Linux terminal.
Installing Pre-Requisites
Let's begin by installing all pre-requisites first:
Installing Java
Right now, some distros do not have OpenJDK 21 yet. If not, it would be as easy as sudo apt install openjdk-21
. However, we will do it manually at the moment.
You can download the OpenJDK 21 For your current architecture from here: https://adoptium.net/temurin/releases/?os=linux
You can use the following in your CLI to do it easier:
Now add the JAVA_HOME
and the path to the jvm in your PATH
using your bash profile
We also need to add it to the sudo
profile.
Type sudo visudo
and add :/usr/lib/jvm/jdk-21.0.3+9/bin
to the end of
Defaults secure_path="other/items/"
Once you add this to your bash profile, either source your shell or type bash
or close and startup again
Please note that this will become a one-liner in future distros. If your distro supports it, you can do sudo apt install openjdk-21
and be done with this step easily.
Installing BoxLang
This is the easy part, just type the following command:
This will run the BoxLang installer. Once you are done, just type boxlang
and boom! We have BoxLang installed!
This opens the REPL and you can start coding away, running BoxLang files, starting servers and so much more.
VSCode BoxLang
Now that we have BoxLang installed, let's get VSCode so you can use this awesome editor for BoxLang coding!
Choose the debian according to your processor and download the package. If you are unsure about your Chromebook's processor, type dpkg --print-architecture
in the Linux terminal for verification. Then double click it and run the installer. Once done, you will have a new icon in your apps called Visual Studio Code
. Click it and open it.
Now go to the Extensions Marketplace and search for BoxLang
. Then install the extension
Now we are cooking. Create a file using the editor and call it Hello.bx
Now right-click on the editor and say BoxLang: Run File
You have coded your first BoxLang class and ran it! Great job! Let's make it harder now and start a web application. Create a file and call it index.bxm
, these are templating files like HTML but spiced up with BoxLang!
This uses the <bx:output>
component to produce output on the website. Then we reuse the now()
built-in function to spit out the date. You can find all about our templating syntax in the language section. Now let's run our BoxLang MiniServer! Open a command palette in VSCode and search for BoxLang
Now click the Run Web Server
. You will get the following in the debug console:
It will open the browser for you as well:
You have now created your very first BoxLang web application. Good for you! Now keep exploring the language syntax and framework so you can now take it to the next level! Enjoy!
This entire guide was written in my awesome Lenovo Duet 5 Chromebook!
Last updated