Minecraft forge 1.18.1 no targetable jar

yes it does

I haven’t really explained how to do it though - apart from my post ^

Hopefully Hexparrot will pull in some changes.

Hey, i followed these steps but refreshing still doesn’t give the universal jar as a launch option? any suggestions. Running java 17, with mineos running on a docker in unraid also

Can you show me a screenshot of the jar in your server directory? Do a ls -la as that’ll give permission info.
Though I didn’t do it in a docker.

struggled to reply to this for a while, not sure if the sit was having some sort of outage.

I ran the command in the docker console, not sure if that’s what you were looking for, still relatively new to all this.

Can’t seem to upload pictures either so here they are In Dropbox

So copy the universal jar to where the installer jar is. Then do the rest of the steps.

i tried that before posting here initially, the server starts, looking promising but then when it gets to preparing spawn area, server goes down with no crash log or any other log entries, just no server.

so this is with universal jar copied into main directory where installer is, still using java arguments you specified, without java argument, server refuses to start at all

The user args thing you need to copy from your file, not what I posted, as it may differ.
If it just crashes out you could check the /var/log/mineos.log

Possibly increase your xmx value but IDK without more info.

Managed to get it working by allocating LESS ram, i only have a single 8gb stick, has been more than sufficient for over a year, guess its time to upgrade. Can only assume when it hit max ram usage it just stopped working all together, couldn’t even generate itself a crash log.

1 Like

Dude, YOU ROCK!
I have been looking for a way to run 1.18 for ages and gave up towards the end of last year.
So glad I decided to look again. Thank You

1 Like

I’m currently trying to install forge to my server but I can’t fins any instructions to do so.

Could you link me what you used or explain what you did?

@hexparrot I’ve come up with two possible ways to handle forge (tested this implementation on 1.18.1).
mineos.js - line 829 (launching the screen in self.start). Add the following -

        var runPath = `${self.env.cwd}/run.sh`; //set the runPath to location of run.sh
        if(sc.java.jarfile.includes('forge') && sc.java.jarfile.includes('installer') && fs.existsSync(runPath)){ //if the selcted jar has forge and installer in the name and the run.sh exists
          var run = fs.readFileSync(runPath, 'utf8').split('\n').filter(line => line.charAt(0) !== '#' && line !== '')[0]; //read the run.sh and just get the executable line 
          var unix_args = `@${run.split('@')[2].split(' "')[0]}`; //get the unix_args.txt location

          var jarIndex = args.findIndex(elm=> elm === '-jar'); // locate the -jar entry in the args array
          args.splice(jarIndex); // remove -jar and later arguments
          args.push(...[unix_args, 'nogui']) // add the unix_args location and nogui
        }

The benefit of this method is you don’t need to change anything else and your xmx,xms settings are respected (though forge requires minimum 1024MB xms/xmx and further JVM args would probably get missed without further refinement on my insertion code).

The second method I haven’t implemented but I envision it would be in the function on line 832 - after you first run the installer you then extract the unix_args.txt location (and use that location to also copy the forge*universal.jar to the root directory) and update the server.config with the unix_args.txt line and set the runnable jar to the universal one.

I can do the work but which method (if any or another) do you want.

This is the code to put into the next function block to copy the jar and update the config with the jarfile and java_tweaks.

        var runPath = `${self.env.cwd}/run.sh`; //set the runPath to location of run.sh
        if(sc.java.jarfile.includes('forge') && sc.java.jarfile.includes('installer') && fs.existsSync(runPath)){ //if the selcted jar has forge and installer in the name and the run.sh exists
          var run = fs.readFileSync(runPath, 'utf8').split('\n').filter(line => line.charAt(0) !== '#' && line !== '')[0]; //read the run.sh and just get the executable line 
          var unixArgsLoc = run.split('@')[2].split('unix_args.txt')[0];
          var unix_args = `@${unixArgsLoc}unix_args.txt`; //get the unix_args.txt location 
          var dir = fs.readdirSync(`${self.env.cwd}/${unixArgsLoc}`).filter(elm=> elm.includes('universal'));
          var universal = `${self.env.cwd}/${unixArgsLoc}${dir[0]}`;
          fs.copyFileSync(universal, `${self.env.cwd}/${dir[0]}`);
          self.modify_sc('java','jarfile',dir[0])
          self.modify_sc('java','java_tweaks',unix_args);
          
        }

The idea of this is that it would run automatically after running a forge installer jar. I just tried it, after running the installer jar, refreshed the page and saw that the java_args bit was there. Clicked start and it booted up.

Third option is another callback function in the chain that pretty much does the same thing. I am thinking that separating things into a handler class or separating the functions into separate files or something might be able to reduce the size of the monolith that is mineos.js

function(err,cb){
        // in theory this will only run if the launch jar is forge*installer.jar and the run.sh has been generated. (meaning this could be run multiple times)
        var runPath = `${self.env.cwd}/run.sh`; //set the runPath to location of run.sh
        if(sc.java.jarfile.includes('forge') && sc.java.jarfile.includes('installer') && fs.existsSync(runPath)){ //if the selcted jar has forge and installer in the name and the run.sh exists
          var binary = which.sync('screen');
          var run = fs.readFileSync(runPath, 'utf8').split('\n').filter(line => line.charAt(0) !== '#' && line !== '')[0]; //read the run.sh and just get the executable line 
          var unixArgsLoc = run.split('@')[2].split('unix_args.txt')[0];
          var unix_args = `@${unixArgsLoc}unix_args.txt`; //get the unix_args.txt location 
          var dir = fs.readdirSync(`${self.env.cwd}/${unixArgsLoc}`).filter(elm=> elm.includes('universal'));
          var universal = `${self.env.cwd}/${unixArgsLoc}${dir[0]}`;
          fs.copyFileSync(universal, `${self.env.cwd}/${dir[0]}`);

          self.modify_sc('java','jarfile',dir[0]);
          self.modify_sc('java','java_tweaks',unix_args);
          self.modify_sc('java','java_xmx', '1024');

          cb();
        } else {
          cb();
        }
      }
1 Like

Hi,

thanks this helped.
I would like to know if you plan to do an upgrade or new release where the JAVA can be updated automatically from the repository and where will be corrected this problems with the forge mode?

I like this MineOS, its a great product.

Thanks.

Hi! Can any make a videotutorial or share a tutorial with screenshots doing it to get Forge 1.18.1 and can start it with .jar . I need it to can start the forge server with multicraft.
Best Regards!

The other threads tell me to come here but by any chance does anyone have a set of clear step by step instructions to be have mineos Bullseye work with 1.18.1 Forge servers? Thanks.

This needs a pin!
:heartbeat:
Thank you for this solution

1 Like

Just got 1.18.2 version of forge working with the solution given by ElPres, thanks for your help, greatly appreciated!!!

Hello and thank you SO MUCH ElPres! I’ve spent hours trying to get this to work before I found your reply! Although I was confused at some points so I made a detailed version. I also have no idea what I’m doing so please correct me if I’m wrong.

  1. In MineOS, go to the profiles tab

  2. Change the tab under ID from Mojang to Forge

  3. Download the version of Forge you would like

Now in MineOS, create a new server or do this process on an existing server

  1. Change the profile under the start button to the version of Forge you just downloaded

  2. Under Java Settings change the runnable jar to forge-[version number]-installer.jar
    *[version number] will be something like 1.20.1-47.1.44 and will be different depending on which version of forge you downloaded

  3. Start the server
    *It shouldn’t succeed

Now connect to your server via an sFTP program (If you don’t know how to do this, look up a tutorial on YouTube, the internet, and/or search through the MineOS forums for answers)

  1. Go to this location in your server: /var/games/minecraft/servers/[YourServerName]/libraries/net/minecraftforge/forge/[version number]
    *[YourServerName] will be the name of your server
    *[version number] will be whatever number it was in the previous steps, something like 1.20.1-47.1.44

  2. Copy the file forge-[version number]-universal.jar to your desktop
    *[version number] will be something like 1.20.1-47.1.44

  3. Go back to this location in your server: /var/games/minecraft/servers/[YourServerName]
    *[YourServerName] will be whatever it was earlier

  4. Copy the file from step 8 here

Now back in MineOS

  1. Under Java Settings change the runnable jar to forge-[version number]-universal.jar
    *If it’s not there, refresh the page

  2. Under Java Settings, paste “@user_jvm_args.txt @libraries/net/minecraftforge/forge/[version number]/unix_args.txt” in Additional Java Arguments
    *Replace [version number] with the number from earlier
    *Do not include the quotations when pasting

  3. Start the server

I hope this helps somebody, I tried to make this as beginner friendly as possible.

1 Like

I want to give many thanks for this, I have created forge servers in the past prior to 1.17 and past few years running mostly paper builds but now that i have played versions up to 1.20 for few months wanted to try out ATM9 & since their server is still in beta and lag is terrible to say the least, again many thanks, i hope mineos lives on!