--- title: Getting started --- This page will help you getting started with CheerpJ and converting your first Java application to JavaScript in no time. To start, make sure to download the latest available version of CheerpJ [here](http://www.leaningtech.com/pages/cheerpj.html#Download). Decompress the Cheerpj 2.2 archive anywhere, for example in ```~/cheerpj_2.2```. **Important:** Converting an applet is documented at the bottom of this page. # Converting a single JAR to a JAR.JS file ```cheerpjfy.py``` is an helper script that automatically takes care of unpacking, compiling and optimising a whole JAR archive. Using ```cheerpjfy.py``` is the recommended way of compiling applications and libraries using CheerpJ. The basic usage is very simple: ``` ~/cheerpj_2.2/cheerpjfy.py my_application_archive.jar ``` This command will generate a file called ```my_application_archive.jar.js```, which needs to be deployed in the same folder of the original .JAR archive, and hosted on a web server. Instructions on how to serve the converted JavaScript on a web page are provided below. **Important:** The files _must_ be accessed through a Web server. Trying to open the HTML page directly from the disk is not supported. The URL must look like ```http://127.0.0.1:8080/cheerpj_test.html```, if it looks like ```file://c/users/Test/cheerpj_test.html``` CheerpJ won't be able to start. **Note to Windows users:** You will need to have python3 installed on the system. Python provides a launcher called ```py``` that will automatically detect and use the right version of python for a given script. To use ```cheerpjfy.py``` on Windows you need to prefix all the commands with ```py```, for example: ``` py c:\cheerpj_2.2\cheerpjfy.py application.jar ``` # Converting multiple JARs to JAR.JS's files If your JAR has any dependencies in the form of further JAR archives, the ```cheerpjfy.py``` command line must be modified as follows: ``` ~/cheerpj_2.2/cheerpjfy.py --deps my_dependency_archive.jar my_application_archive.jar ``` This command will generate ```my_application_archive.jar.js``` but **not** ```my_dependency_archive.jar.js```. Each archive should be compiled separately by invoking ```~/cheerpj_2.2/cheerpjfy.py my_dependency_archive.jar```. It is in general safe to put the target JAR in the ```--deps``` list, although it is not required. If you have an application composed of many JARs you can do something like this: ``` for f in one.jar two.jar three.jar do ~/cheerpj_2.2/cheerpjfy.py --deps one.jar:two.jar:three.jar $f done ``` # Basic HTML page for testing a Java application ```html
not able to load Java applet