1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tutorial [2024] Setting up IntelliJ

Discussion in 'Tutorials & Resources' started by Michaud.retard, Aug 16, 2020.

  1. Michaud.retard

    Joined:
    Sep 14, 2019
    Messages:
    18
    Likes Received:
    15
    To check the last update for this guide, look in the comment section.

    You can either click here or search "IntelliJ" on Google to download IntelliJ. On the download page, select the Community Edition.

    Once the IntelliJ download is finished, proceed with the installation. No special configuration is needed at this stage.​
    • The "Customize IDE" screen will appear. Select any desired options, or alternatively, click "Skip All and Set Defaults."
    Next, select "Create New Project."​
    1. Click on the project SDK bar and select the option "Download JDK."
    2. In the "Download JDK" window, click on the vendor bar and choose either "Oracle OpenJDK" or "JetBrains Runtime."
    3. Select "17.0.0" (or a higher version) and click the download button.
    4. Click "Next" until you reach the "Project name" textbox. I named my project "Runemate," but you can choose any name you prefer.
    Press "Ctrl+Alt+Shift+S" to open the project structure.​
    1. In project settings, select "Modules."
    2. Click on the "Dependencies" tab.
    3. On the left side of the panel, click the + button and select "JARs or directories."
    4. Add the following dependencies:
      • C:\Program Files\RuneMate\RuneMate.jar
      • C:\Users\%user%\RuneMate\resources\runemate-game-api.jar
    5. Click the "OK" button.
    You can also use the Standalone version, but remember to manually update the dependencies.​

    In the main IntelliJ window, navigate to Run → Edit Configurations.​

    In the dialog that appears, click the "+" button and select "Application."​

    1. In the "Name" field, choose the desired name (e.g., "Launch").
    2. In the "Main class" field, paste:
      Code (Text):
      1. com.runemate.client.boot.Boot
    3. In the "Program arguments" field, paste:
      Code (Text):
      1. --dev
    4. In the "Environment variables" field, replace "Username" and "Password" with your actual credentials:
      Code (Text):
      1. RUNEMATE_USERNAME=YourUsername; RUNEMATE_PASSWORD=YourPassword
    5. Click the "OK" button.

    If the project sidebar is not open, press "Alt+1."​

    1. Right-click the "src" folder → New → Package.
    2. Name your package as follows: "com.username.scripts" (Replace "username" with your actual username.)
    3. Right-click the project bar, then select "Compact Middle Packages."
    4. Right-click the "scripts" folder → New → Package. Name the package "test."

    In the new "test" package, create a Java Class named "Test" and a new file named "test.manifest.xml."​

    In the Java Class, copy and paste this code:
    Code (Text):
    1. package com.username.scripts.test;
    2.  
    3. import com.runemate.game.api.script.framework.LoopingBot;
    4.  
    5. public class Test extends LoopingBot {
    6.     @Override
    7.     public void onLoop() {
    8.  
    9.     }
    10. }
    In the XML file, copy and paste this code:
    Code (Text):
    1. <manifest>
    2.     <main-class>com.username.scripts.test.Test</main-class>
    3.     <name>Test</name>
    4.     <description>This is a test.</description>
    5.     <version>0.0.1</version>
    6.     <compatibility>
    7.         <game>OSRS</game>
    8.     </compatibility>
    9.     <categories>
    10.         <category>COOKING</category>
    11.     </categories>
    12. </manifest>
    For a full manifest, you can find it here.

    You're now ready to run for the first time. Press the green play button at the top right of the IDE or use the shortcut "Shift+F10."

    Once RuneMate is launched and you are logged in, press "Ctrl+P."

    1. In the development section, click on "Change."
    2. Navigate to your project folder → out → production → Runemate and click "Select folder" (Ensure you select the folder above the "com" folder.)
    You should now see the "Test" bot in the "BOTS" section.

    If you have any questions, feel free to comment below or join the RuneMate Discord.​
     
    #1 Michaud.retard, Aug 16, 2020
    Last edited: Apr 16, 2024 at 6:45 AM
  2. bawdog

    Joined:
    Jun 13, 2015
    Messages:
    18
    Likes Received:
    1
    On run/debug configuration it says "Warning: Class 'com.runemate.boot.Boot ' not found in module 'Runemate'"

    and then when building and running it says "
    Error: Could not find or load main class com.runemate.boot.Boot

    Process finished with exit code 1"

    EDIT: I was able to resolve it by changing JRE in IntelliJ to default "of ruemate module" and checking include dependencies with "provided" scope
     
    #2 bawdog, Aug 21, 2020
    Last edited: Aug 21, 2020
    palyfight likes this.
  3. Finalmen

    Joined:
    Jun 12, 2020
    Messages:
    1
    Likes Received:
    1
    Thanks for this updated guide, I had a couple of issues I will note her:

    - On first run the ''test class'' did not extend a bot/script bot. Adding ''extends LoopingBot" and extendingthe onLoop functionality made that work.
    - The JRE from Amazon for me is 64 bit. I could not figure out how to get it to 32 bit. In the end, instead of downloading a new JREI went into the run/debug configurations settings and changed the location to the RuneMate JRE which was already on this PC. This resolved this issue.

    Kind Regards,

    Finalmen
     
    Michaud.retard likes this.
  4. Voomeup

    Joined:
    Jul 23, 2020
    Messages:
    1
    Likes Received:
    0
    Hi, thanks for the guide!
    I'm still getting:

    Error: Could not find or load main class com.runemate.boot.Boot
    Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
     
  5. BTDubsy

    Joined:
    May 13, 2020
    Messages:
    2
    Likes Received:
    2
    Hi, I got to the end and I have two things. One, the username and password when the client opens are both "username", im not sure if thats supposed to be like that. But I logged in anyway and went to my account and when trying to find the local bot directory I went to out then production and then Runemate but there was no "com" file anywhere and when trying to set the file to Runemate there was only the dev toolkit under the bots section.
     
    Jefferonv2 likes this.
  6. Clinical

    Joined:
    Sep 30, 2020
    Messages:
    1
    Likes Received:
    1
    Thank you very much for putting this together, it was super helpful.

    If anyone sees the error message
    Code (Text):
    1. com.username.scripts.test.test is not an instance of AbstractBot
    Then you need to do the above like Finalmen pointed out, and modify the class to be:
    Code (Text):
    1. package com.username.scripts.test;
    2.  
    3. import com.runemate.game.api.script.framework.LoopingBot;
    4.  
    5. public class test extends LoopingBot {
    6.     @Override
    7.     public void onLoop() {
    8.        
    9.     }
    10. }
    11.  
     
    Fump likes this.
  7. Tiagoo

    Joined:
    Dec 13, 2019
    Messages:
    5
    Likes Received:
    0
    Where is it the local bot directory in my account? I could't find it
     
  8. Chewie69

    Joined:
    Jan 22, 2017
    Messages:
    2
    Likes Received:
    0
    local script bot isn't showing up after set local folder
    --- Double Post Merged, Nov 10, 2020, Original Post Date: Nov 10, 2020 ---
    the out > production > *bot name* folder is also empty
     
  9. Fump

    Joined:
    Dec 5, 2019
    Messages:
    1
    Likes Received:
    0
    No when the client opens it should have your correct username and password not sure where you missed it, perhaps in the run edit configurations part. The com file should be there you may have to hit the build project button next to the run button in intellij in order to create the files. Also the
    <main-class> in the XML should point to the same location. Also Clinical has a solution to the Abstract Bot error. If you get it you have to stop and rerun.
     
  10. Ewannnnn

    Joined:
    Apr 22, 2021
    Messages:
    1
    Likes Received:
    0
    I'm trying to set this up on Ubuntu 20.04 and I'm getting the following error whenever I run the bot:

    Code (Text):
    1. Exception in thread "main" java.lang.reflect.InvocationTargetException
    2.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    3.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    4.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    5.     at java.lang.reflect.Method.invoke(Method.java:498)
    6.     at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:873)
    7. Caused by: java.lang.UnsupportedOperationException: Internal Error
    8.     at com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(GtkApplication.java:158)
    9.     at java.security.AccessController.doPrivileged(Native Method)
    10.     at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:140)
    11.     at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
    12.     at com.sun.glass.ui.Application.run(Application.java:146)
    13.     at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:278)
    14.     at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
    15.     at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
    16.     at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
    17.     at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    18.     ... 5 more
    Anyone know what the problem could be here?

    Edit: Turns out I needed to use the 64 bit JRE!
     
    #10 Ewannnnn, Apr 23, 2021
    Last edited: Apr 23, 2021
  11. Gold Farming Inc

    Joined:
    Jan 27, 2020
    Messages:
    3
    Likes Received:
    0
    You are my god, bro. This worked for me. I didn't know about this option to download the JDK, really cool. So the only thing I needed to do before this was download the Windows 64 bit of Runemate.

    One small thing that did trip me up for 15 minutes or so, was there was no bots showing up in runemate after I set the path.

    But there are an error message in intellij about a file not being found. The cause was because of the not consistent-ness of bot vs script bot terminology, so if anyone has this problem, double check the manifest main class thing matches the package name.

    Thanks again, someone should give you some big bucks!
     
  12. iqcudi

    Joined:
    Dec 27, 2022
    Messages:
    1
    Likes Received:
    0
    Hey, great tutorial! I have a question tho, how would I go about setting this up to be able to work with Kotlin? I am a Kotlin developer and it would be so much easier to work with it... Thanks in advance!
     
  13. Hejhej

    Joined:
    Oct 2, 2015
    Messages:
    57
    Likes Received:
    14
    Hey, thanks for the guide! Got the module to work atleast but now im facing another problem.

    Any idea how to solve this? Thanks in advance :)

    upload_2023-3-16_12-30-33.png
     
  14. Michaud.retard

    Joined:
    Sep 14, 2019
    Messages:
    18
    Likes Received:
    15
    LAST EDIT 03/30/2023 - Made some small change here and there.
    --- Double Post Merged, Mar 30, 2023, Original Post Date: Mar 30, 2023 ---
    Name of public class must match the name of .java file in which it is placed (like public class Foo{} must be placed in Foo.java file). So either:
    • rename your file from Main.java to WeatherArray.java
    • rename the class from public class WeatherArray { to public class Main {
    Hope this resolve your issue. You will have more chance to get answer to your question in the discord.
     
  15. iamvo

    Joined:
    Nov 19, 2017
    Messages:
    3
    Likes Received:
    0
    upload_2023-9-25_22-7-14.png
    Do I need to be exactly on Amazon corretto 11.0.14? If so can someone link me cause I only see 11.0.20
     
  16. sethtroll

    Joined:
    Aug 13, 2023
    Messages:
    1
    Likes Received:
    2
    This post needs to be updated, but you need to use Eclipse Adoptium Temurin-17 now
     
    crazykilz and JaredCH like this.
  17. FrostyGhost

    Joined:
    Feb 8, 2022
    Messages:
    46
    Likes Received:
    7
    Ignore this, I just noticed an updated guide.
     
  18. Michaud.retard

    Joined:
    Sep 14, 2019
    Messages:
    18
    Likes Received:
    15
    Thank you to @Bing Bong for the update.
    --- Double Post Merged, Apr 16, 2024 at 6:39 AM, Original Post Date: Apr 11, 2024 ---
    Updated the guide with grammar corrections for improved clarity and readability.
     
    Bing Bong likes this.

Share This Page

Loading...