#How do I pass JVM args into gradle IntelliJ
1 messages · Page 1 of 1 (latest)
<@&987246554085740594> please have a look, thanks.
org.gradle.jvmargs=-Xmx3G -Ddevauth.enabled=true -Ddevauth.configDir=/Users/name/.devauth -Ddevauth.account=main
heres mygradle.properties file
you mean jvm arguments like -Xmx etc right? or do you mean arguments for public static void main(String[] args)?
-Xmx i believe
I think you can just change the applicationDefaultJvmArgs in the build.gradle
from the documentation they tell me this
DevAuth is configured through JVM properties and a configuration file. JVM Properties can be by adding -D<propertyName>=<value> to your JVM arguments or by using System.setProperty before DevAuth is initialized (fabric preLaunch entrypoint for example).
yeah then you most likely want to change these
Ill give those a try real quick
wdym buildscript? it should be in build.gradle
uh oh
mod-main'.
> Could not set unknown property 'applicationDefaultJvmArgs' for object of type org.gradle.api.internal.initialization.DefaultScriptHandler.```
share your build.gradle
repositories {
jcenter()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
applicationDefaultJvmArgs = ['-Ddevauth.enabled=true']
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
/*
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "1.0"
group= "dev.px.hud" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
mappings = "stable_20"
// makeObfSourceJar = false
}
repositories {
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
maven {
url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1"
}
mavenCentral()
jcenter()
}
dependencies {
// implementation ('se.michaelthelin.spotify:spotify-web-api-java:7.3.0') {
// for dev env
//runtimeOnly ("me.djtheredstoner:DevAuth-forge-legacy:1.2.0")
}
reobf {
shadowJar {
mappingType = 'SEARGE'
classpath = sourceSets.main.compileClasspath
}
}```
Detected code, here are some useful tools:
buildscript {
repositories {
jcenter() maven {
name = "forge"url = "https://files.minecraftforge.net/maven"}
}
dependencies {
classpath'org.spongepowered : mixingradle : 0.6 - SNAPSHOT'classpath'com.github.jengelman.gradle.plugins : shadow : 1.2.3'classpath'net.minecraftforge.gradle : ForgeGradle : 2.1 - SNAPSHOT'}
applicationDefaultJvmArgs = [' - Ddevauth.enabled = true'] }
apply plugin : 'net.minecraftforge.gradle.forge'apply plugin : 'com.github.johnrengelman.shadow'/*
// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot
plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "1.0"group = "dev.px.hud"// http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"runDir = "run"mappings = "stable_20"// makeObfSourceJar = false
}
repositories {
maven {
name = "jitpack.io"url = "https://jitpack.io"}
maven {
url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1"}
mavenCentral() jcenter() }
dependencies {
// implementation ('se.michaelthelin.spotify:spotify-web-api-java:7.3.0') {
// for dev env
//runtimeOnly ("me.djtheredstoner:DevAuth-forge-legacy:1.2.0")
}
reobf {
shadowJar {
mappingType = 'SEARGE'classpath = sourceSets.main.compileClasspath}
}
ah well I think applicationDefaultJvmArgs is only for application plugins
ah I see
also that line shouldnt be in buildscript
I realized that yeah
try putting it outside
same deal
> Could not set unknown property 'applicationDefaultJvmArgs' for root project 'mod-main' of type org.gradle.api.Project.```
do you think there is a way I can get it to work with the gradle.properties file
hm I just looked and this should actually work
what happens if you put that
ah nvm
these are for the build vm
so try in gradle.properties:
JAVA_OPTS="-Xmx3G -Ddevauth.enabled=true -Ddevauth.configDir=/Users/name/.devauth -Ddevauth.account=main"
there is also this in context of minecraft forge, though its a bit older
im on an older version of forge so that might owrk
there is another option of putting the jar folder in my mods instead of compiling at runtime im going to try that too
Im on an older version of gradle (4.1) do you think it could be that
uh not sure but why using old stuff in the first place 
just downloaded the mdk like that and didnt bother to change it
also it breaks on my pc sometimes with the newer gradle and old forge
well I mean old forge, its not really supported
fair
ok I think I got it to work?
at me.djtheredstoner.devauth.common.auth.MojangAuthProvider.login(MojangAuthProvider.java:24) ~[MojangAuthProvider.class:?]
at me.djtheredstoner.devauth.common.DevAuth.login(DevAuth.java:62) ~[DevAuth.class:?]
at me.djtheredstoner.devauth.common.DevAuth.processArguments(DevAuth.java:35) ~[DevAuth.class:?]
at me.djtheredstoner.devauth.forge.legacy.ForgeLegacyBootstrap.processArguments(ForgeLegacyBootstrap.java:10) ~[ForgeLegacyBootstrap.class:?]
at net.minecraft.client.main.Main.main(Main.java) ~[Main.class:?]
... 12 more```
Detected code, here are some useful tools:
im going to take this as a good sign lol
just try to print System.getProperty to see if they exist at runtime
