Skip to content

Getting Started

piitex edited this page Jan 23, 2025 · 20 revisions

Getting Started

There are a few ways to create a RenJava project. The toolkits for RenJava are not complete and this may change in the future. The first is to use RSDK-GUI. RSDK-GUI is the easiest way to build your project but it's very primitive. The next way is to use the old RSDK. This doesn't completely create your project for you.

RSDK-GUI

Warning, RSDK-GUI is in a primitive state. Please be careful when selecting directories. An internet connection is required. Only works for Windows systems.

First download RSDK-GUI. Next, download and install Git, then download and install Java 21. Double click the rsdk-gui.jar file or type in a terminal java -jar rsdk-gui.jar.

Type in the information for your project and follow the instructions. RSDK-GUI will automatically install RenJava and create your project environment. Open the project folder with an IDE of your choosing. I personally use Intellij Community

RSDK OLD

Download and install both Git and Java 21. Download and install an IDE of your choosing. I personally use Intellij. Create an empty maven project and open the default pom.xml.

Paste the following into the pom file after the <properties> configuration.

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <source>21</source>
                    <target>21</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>me.piitex.renjava.Main</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

Now you will have to create a main class and extend RenJava. Make sure you implement the methods.

@Game(name = "My Game", version = "1.0.0", author = "you")
@Configuration(title = "{name} v{version}", width = 1920, height = 1080)
public class MyGame extends RenJava {

}

Next run mvn clean install within the IDE terminal or Maven side bar. You may have to install Maven, instructions will be at the end of this page. Now download [RSDK] and place it into the root directory of your project file. The same location where the pom.xml file is. Now run java -jar YOURRSDKFILE.jar --color blue in a terminal. You can view all colors in the RSDK README.md file.

Installing Maven on Windows

Download the binary zip archive and open it with a zip tool. The zip will have a folder, please enter that folder and select all contents. Below is an example of what you should have selected.

|_bin
|_boot
|_conf
|_lib

Extract the contents into C:\Program Files\Maven. You will have to create the Maven folder which will require administrator privileges. In the windows search bar type Edit the system environment variables. A box will pop up and select the button that says Environment Variables. A menu will pop up with two boxes. Go to the bottom box that says System Variables and locate the variable Path. Click on it and select the button that says Edit.

A new box will pop up. Press the button that says New. Copy C:\Program Files\Maven\bin\ into the new text field. Press Ok on ALL windows and boxes. Congrats, maven should be installed. Open a new terminal and type mvn --version to verify.

Clone this wiki locally