Jump to content

Can forge (as a jar) run minecraft server? (1.5.2)


keybounce

Recommended Posts

I am actually uncertain if this is supported or not; I thought it was, but I can't make it work.

 

I am trying to use forge (152/738) to run a minecraft server. I was under the belief that starting with the 1.5 series, forge could be run as the main jar, and launch an unmodified server jar, without needing to patch anything.

 

If I'm wrong, just say so. Otherwise, what's wrong with

java -Xms40m -Xmx500m -jar forge.jar minecraft_server-152.jar nogui

 

The only output:

Exception in thread "main" java.lang.NoClassDefFoundError: ab
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Caused by: java.lang.ClassNotFoundException: ab
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 12 more

 

No log files.

 

Jeb! The sheep! The fence pens, they do nothing still leak!

Link to comment
Share on other sites

(Silly, silly me. Thank for you the forum "auto search", but it comes AFTER the post is posted).

 

So the answer is: the server has to be called "minecraft_server.jar".

 

java -Xms40m -Xmx500m -jar forge.jar minecraft_server.jar nogui

 

works just fine.

 

Jeb! The sheep! The fence pens, they do nothing still leak!

Link to comment
Share on other sites

Yes, 1.5.2 Forge was developed before they started putting the version name in the jar file, so you can either run it as:

java -cp minecraft_server.1.5.2.jar -jar forge.jar nogui

Or rename it to 'minecraft_server.jar' and just run it as:

java -jar forge.jar nogui

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Alright, I am having trouble with this.

 

I have two servers; one works with this, one does not.

 

Both are using 152, forge 738.

 

This one starts up just fine:

(Only mods on server: Forge, chickencore, NEI)

(server is a test running a superflat world)

 

#!/bin/bash 
cd "$( dirname "$0" )" 
# java -Xms30m -Xmx700m -jar craftbukkit.jar 

java -Xms40m -Xmx500m  \
-d32 -server \
-XX:+UseAdaptiveGCBoundary \
-XX:TargetSurvivorRatio=90 \
-XX:CompileThreshold=300 \
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC \
-XX:CMSInitiatingOccupancyFraction=80 \
-XX:SoftRefLRUPolicyMSPerMB=0 \
-XX:MaxPermSize=150m \
-XX:MaxHeapFreeRatio=25 \
-XX:MinHeapFreeRatio=21 \
-XX:+DisableExplicitGC \
-XX:MaxTenuringThreshold=4 \
-XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution \
-XX:+PrintCommandLineFlags -XX:+PrintGCDetails -Xloggc:GC.log \
-jar -cp minecraft_server-152.jar -jar forge.jar nogui lighting

# LDS: 12 to 24 MB
# Copy: Needs to be more than 1.6 MB (default).

 

Yes, that is "-jar -cp" -- that came from a bad editing insert, but it works.

This one does not:

 

exec $java \
        $JVM_SIZE \
        -Xms${START}m -Xmx${MAX}m \
        -XX:NewSize=${NEW}m -XX:MaxNewSize=${MaxNew}m \
        -XX:+UseAdaptiveGCBoundary \
        -XX:TargetSurvivorRatio=$TargetSurvivorRatio \
        -XX:SurvivorRatio=$RATIO \
        -XX:CompileThreshold=300 \
        -XX:+UseConcMarkSweepGC -XX:+UseParNewGC \
        -XX:CMSInitiatingOccupancyFraction=$CMSInitiatingOccupancyFraction \
\
        -XX:SoftRefLRUPolicyMSPerMB=0 \
        -XX:MaxPermSize=150m \
        -XX:+UseParNewGC \
        -XX:MaxHeapFreeRatio=25 \
        -XX:MinHeapFreeRatio=21 \
        -XX:+DisableExplicitGC \
        -XX:MaxTenuringThreshold=4 \
        -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution \
        -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -Xloggc:GC.log \
        -jar -cp minecraft_server-152.jar -jar forge.jar nogui 152mystIntroWorld

 

Gives this crash:

Exception in thread "main" java.lang.NoClassDefFoundError: ab
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Caused by: java.lang.ClassNotFoundException: ab
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 12 more

 

And just to double check, here's the "echo" of that command line:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java \
-d32 -server \
-Xms199m -Xmx550m \
-XX:NewSize=114m -XX:MaxNewSize=450m \
-XX:+UseAdaptiveGCBoundary \
-XX:TargetSurvivorRatio=90 -XX:SurvivorRatio=1 \
-XX:CompileThreshold=300 \
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC \
-XX:CMSInitiatingOccupancyFraction=80 \
-XX:SoftRefLRUPolicyMSPerMB=0 \
-XX:MaxPermSize=150m \
-XX:+UseParNewGC \
-XX:MaxHeapFreeRatio=25 -XX:MinHeapFreeRatio=21 \
-XX:+DisableExplicitGC \
-XX:MaxTenuringThreshold=4 -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution \
-XX:+PrintCommandLineFlags -XX:+PrintGCDetails -Xloggc:GC.log \
-jar -cp minecraft_server-152.jar -jar forge.jar nogui 152mystIntroWorld

 

(Yes, looking over that echo, MaxNew needs to be adjusted, but that's not an issue here. Apple's java, if given both NewSize and MaxNewSize, and using the CMS collector, will never actually adjust the memory in Eden, and the extra is just never used and wasted. I can't test Oracle's Java 6 (obviously :-) and J7 on macs still had issues last time I tried.)

 

What does work is changing the last line of that to

        -jar forge.jar nogui 152mystIntroWorld

 

with a copy of the server in "minecraft_server.jar".

 

keybounceMBP:Myst10.5-78 michael$ ls minecraft*
2308 minecraft_server-152.jar  2308 minecraft_server.jar
keybounceMBP:Myst10.5-78 michael$ 

Jeb! The sheep! The fence pens, they do nothing still leak!

Link to comment
Share on other sites

Ok, help needed once more.

 

I have a jar mod that I want to use with Forge. It's compatible with forge (more village biomes, the 1.5.x versions, http://www.minecraftforum.net/topic/1430150- ).

 

At the moment, I have to unzip the jar, unzip and add in forge, and then that mod.

Is there a way to use unmodified jars given that this mod wants to be inside the jar?

Jeb! The sheep! The fence pens, they do nothing still leak!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.