Get Started with TotalCross

It's time to give your first steps on TotalCross.

To get started

  • 1

    You need an IDE (we recommend VSCode, but any will do)
  • 2

    You need Java (VSCode: Java11, any other IDE: Java8)
  • 3

    You need Maven
  • 4

    Download TotalCross and start coding!
On versions 2.0.0 or above from totalcross-maven-plugin you need to agree to the Terms of Use from Azul. Alternatively, you can change the jdk used to any Java version you prefer to use. How to do it is described here.

Download the TotalCross SDK

  • For VSCode (Microsoft)
    Make sure your VSCode is updated and download the TotalCross VSCode plugin.

    It includes the TotalCross SDK and sets up your project folder structure so you can jump in the coding part straight away.

    Need help? Check this article.

  • For any other IDE
    Download this repository and follow the instructions on its README file.

    The process is a bit more involved, and that's why we recommend using VSCode with our plugin. But you can definitely do it!

    Need help? Check this video or this article for IntelliJ, this video> or this article for Eclipse.

Hello World!

Creating your first application with TotalCross

For VSCode

Step 1 - Create a new TotalCross project called Hello World.

How? From the VSCode Command Palette (CTRL + Shift + P on Windows, ⇧⌘P on Mac), type TotalCross and select TotalCross: Create new Project.

Step 2 - A new window will open with your project.

Right click the RunHelloWorldApplication.java file inside src/main/com/totalcross and choose Run. The TotalCross simulator will open with your brand new application.

Tip - To fill in the prompted questions:

GroupId is the domain of your company backward as in org.wikipedia for wikipedia.org. Feel free to leave it as com.totalcross for now.

ArtifactId is the name of your application, for this example type HelloWorld.

Select the latest version of TotalCross SDK and choose whatever platform you intend to deploy your application.

For other IDEs

Step 1 - Open yur IDE and import the Hello World repository you downloaded.

Step 2 - Inside src/main/java/com.totalcross, right-click the RunHelloWordApplication.java and choose Run. The TotalCross simulator will open with your brand new application.

Need help? Check this video for IntelliJ or this one for Eclipse.

Packaging and Deployment

Fishing your project

For VSCode

Packaging:
Step 1: Open VSCode Command Palette (CTRL+Shift+P on Windows, ⇧⌘P on Mac) and search for TotalCross: Package.

Step 2: When the packaging process is finished the target program will take place inside the folder target/install/~platform~.

Deployment:
Deployment is currently working only for linux arm programs. This feature performs the implementation and execution of the platform via ssh.

Step 1: Open VSCode Command Palette (CTRL + Shift + P on Windows, ⇧⌘P on Mac) and search for TotalCross: Deploy&Run. If you just want to deploy, choose the option TotalCross: Deploy.

Step 2: Fill in the device information.

Step 3: See the result on a display connected to your device or with a VNC client.

For other IDEs

Packaging and deploying in other IDEs is not an autamatic process.

Please check this article if you use IntelliJ or this article if you use Eclipse. If you use other IDEs and these articles are not helpfull, please drop us a line in our Telegram Community or our Discord channel.

First embedded project with TotalCross

Follow this step by step tutorial on how to build your first embedded application using TotalCross.

Got stuck or need any help?

Join our Telegram Community or our Discord channel.