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



×
×
  • Create New...

Important Information

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