I am trying to make minecraft mods and I have to run "./gradlew setupDevWorkspace" in terminal. Every time I try, I get an error message: . Can anybody help me fix that error in terminal mac OS X 10.6.8? Thanks a lot in advance.
-
1Can you post the exact error you got from the terminal? That definitely helps – smac89 Jan 18 '15 at 23:03
-
1possible duplicate of [How to deal with "java.lang.OutOfMemoryError: Java heap space" error (64MB heap size)](http://stackoverflow.com/questions/37335/how-to-deal-with-java-lang-outofmemoryerror-java-heap-space-error-64mb-heap) – smac89 Jan 18 '15 at 23:04
-
what version of forge are you using? What happens if you use `setupDecompWorkspace`? – EDToaster Jan 18 '15 at 23:07
-
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, **a specific problem or error** and the shortest code necessary to reproduce it in the question itself. – Hot Licks Jan 18 '15 at 23:32
-
@HotLicks the problem involves no code at all. – EDToaster Jan 19 '15 at 00:25
-
@JClassic - It also apparently doesn't involve a "specific problem or error". – Hot Licks Jan 19 '15 at 00:28
-
@HotLicks, the problem (from what i've read) is that the build for the minecraft workspace has failed because of insufficient heap space for gradle. – EDToaster Jan 19 '15 at 00:30
-
@JClassic - Except that no one has actually said that. "java heap space, build failed." could mean lots of things. – Hot Licks Jan 19 '15 at 00:36
-
@HotLicks for this specific application, you would need to have experience with modding minecraft, (which he clearly states), to know that there is only one possibility that you would get this output from the terminal. – EDToaster Jan 19 '15 at 00:37
-
@JClassic - I would hope that the actual error message was more complete than that. (Or that it would at least say "Java" and not "java".) – Hot Licks Jan 19 '15 at 00:40
-
Sorry about the horrible question I wrote. I was much younger and didn't understand the purpose of this site – Davis Last Jan 28 '17 at 03:11
3 Answers
set JAVA_OPTS=-Xmx1024m
and then run your program
export JAVA_OPTS=-Xmx1024m
gradlew

- 966
- 2
- 13
- 40
In your forge directory, create a file gradle.properties
file. (basic text file with .properties
end.)
within it, add the following line: org.gradle.jvmargs=-Xmx1024M
try re-run the setupDevWorkspace. If error persists, raise the number higher than 1024

- 3,160
- 3
- 16
- 25
if you want to permanently increase the maximum heap size java can create on your OS X 10.6 machine for programs launched from the command line, edit /etc/profile:
sudo nano /etc/profile
and add a line at the top of the file something like:
export _JAVA_OPTIONS='-Xmx2g'
where 2g means 2GB of virtual memory. there's plenty of advice out there on what to set this to exactly, given the specs of your machine.
After setting this, open a new terminal window and any JVM started there will use the new default. This advice does not apply to applications not started from the command line or OS X later than 10.6.
To check what it currently is, use:
java -XX:+PrintFlagsFinal | grep MaxHeapSize
which will give you the current default in bytes (on the first line of output, which might be followed by a lengthy usage statement).

- 134
- 2
- 10
-
You can do this for convenience to start with, but once you know how much your apps use you might be off configuring each JVM for the expected use - so you don't run out of memory with concurrent apps. – WillC Nov 09 '16 at 02:10