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

Tutorial [2022] Setting up IntelliJ

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

  1. Michaud.retard

    Joined:
    Sep 14, 2019
    Messages:
    17
    Likes Received:
    14
    To see when and what was the last update from this guide look into the comment section.
    • Either click here or search IntelliJ on Google in order to download IntelliJ. On the download page, select the Community Edition.

    • When the IntelliJ download is finished, you can go ahead and install it - no special configuration is needed here.

    • The "Customize IDE" screen will show up. Select any options you want, or alternatively, click "Skip All and Set Defaults"

    • Select "Create New Project"

    • In the "New project" window, you'll need to pick the project SDK.
      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 select "Amazon Corretto".
      3. Click on the version bar and select "11.0.14" then click the download button.
      4. Click "Next", and keep doing so until you reach the "Project name" textbox. I called my project Runemate, but you can call it whatever you want.

    • Press "Ctrl+Alt+Shift+S" to open the project structure.
      1. In project setting 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. With RuneMate installed you can find the dependencies under
      Code (Text):
      1. C:\Program Files\RuneMate\RuneMate.jar
      2. C:\Users\%user%\RuneMate\resources\runemate-game-api.jar
      You can use the Standalone but you will need to manually update the dependencies.
      5. Click on the "OK" button.

    • On the main IntelliJ window, select Run → Edit Configurations.

    • On the dialogue which appears, click the "+" button, and select "Application"
      1. In the "Name" field choose the name you want. Mine is "Launch".
      2. In the "Main class" field copy paste
      Code (Text):
      1. com.runemate.client.boot.Boot
      3. In the "Program arguments" field copy and paste.
      Code (Text):
      1. --dev
      4. In the "Environment variables" field. Replace Username to your username and Password to your password.
      Code (Text):
      1. RUNEMATE_USERNAME=Username; RUNEMATE_PASSWORD=Password
      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 follow "com.username.scripts" (Replace "username" by your username)
      3. Right click the project bar then Compact Middle Packages.
      4. Right click the "scripts" folder → New → Package. Name the package "test".

    • In the new package name "test" create a Java Class named "test" and a new file named "test.manifest.xml".

    • In the Java Class copy and paste this code. (Replace username to your username)
      Code (Text):
      1.  
      2. package com.username.scripts.test;
      3.  
      4. import com.runemate.game.api.script.framework.LoopingBot;
      5.  
      6. public class test extends LoopingBot {
      7.     @Override
      8.     public void onLoop() {
      9.        
      10.     }
      11. }

    • In the xml file copy and paste this code. (Replace username to your username.)
      For a full manifest click here.
      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>
    • You're now ready to run for the first time. Press the green play button on the top right of the IDE or you can use the shortcut "Shift+F10".

    • Now that RuneMate is launched and that you are logged in press "Ctrl+P".
      1. In the development section click on "Change"
      2. Go in your project folder → out → production → Runemate and click "Select folder" (Make sure to select the folder above the "com" folder)

    • You should now be able to see the "Test" bot in the "BOTS" section.
    If you have any question comment it down below or join the Runemate Discord.
     
    #1 Michaud.retard, Aug 16, 2020
    Last edited: Mar 30, 2023
  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:
    17
    Likes Received:
    14
    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.
     

Share This Page

Loading...