Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gradle keep comming back #225

Open
Renarde-dev opened this issue Mar 12, 2023 · 7 comments
Open

.gradle keep comming back #225

Renarde-dev opened this issue Mar 12, 2023 · 7 comments

Comments

@Renarde-dev
Copy link

Even after adding export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle to my zshrc file, .gradle kept coming back.
From what I understand, this is because Jetbrains product ( IntelliJ, Android Studio, etc... ) don't follow environment variable and hardcode $HOME/.gradle

Maybe this issue is related https://youtrack.jetbrains.com/issue/IDEA-141832

The only fix I found is adding my gradle path in the setting of each Jetbrains product that use gradle.
File > Settings > Build, Execution, Deployment > Build Tools > Gradle

@Renarde-dev
Copy link
Author

Renarde-dev commented Mar 12, 2023

Jetbrains product also make .java come back every time the only fix I have found is to add -Djava.util.prefs.userRoot=.config/java to each .vmoption

@b3nj5m1n
Copy link
Owner

Hi, thank you for reporting this, and sorry the suggestion isn't working properly!

I don't have the time to update the suggestion myself at the moment, so if you (or anyone else) happen to have some time, I'd greatly appreciate if you made a PR with added instructions for Jetbrains software.

@62832
Copy link

62832 commented Mar 21, 2023

To that I'd also like to add that specifying locations for anything to do with Maven seems to do nothing on IDEA, considering that it insists on creating a ~/.m2 directory in which to store dependencies from Maven repositories.

JetBrains' Rider also suffers from a similar deal, creating ~/.nuget and ~/.templateengine without fail.

@62832
Copy link

62832 commented Mar 24, 2023

Never mind, much of this seems to be caused by the general idea that GUI applications don't necessarily follow environment variables set for the shell. OP's issue can be solved just fine by setting the variable instead in something such as .xprofile or whatever else is used by their desktop environment.

@Renarde-dev
Copy link
Author

Hi, I don't know what would be used by Gnome wayland.

@62832
Copy link

62832 commented Mar 24, 2023

Hi, I don't know what would be used by Gnome wayland.

This seems to have the answer for it. In general, you'd want to figure out how to set environment variables for the graphical session as opposed to the shell.

@Renarde-dev
Copy link
Author

I after reading and testing out things. I think I've what works !
First I need to create $HOME/.config/.config/environment.d/profile.conf and add my environment variables, for exemple :

# XDG vars
XDG_DATA_HOME=$HOME/.local/share
XDG_CONFIG_HOME=$HOME/.config
XDG_STATE_HOME=$HOME/.local/state
XDG_CACHE_HOME=$HOME/.cache

#Env Vars
_JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle
ANDROID_HOME="$XDG_DATA_HOME"/android
IPYTHONDIR="${XDG_CONFIG_HOME}/ipython"
HISTFILE="$XDG_STATE_HOME"/zsh/history
VIMINIT="source ~/.config/vim/vimrc"
WINEPREFIX="$XDG_DATA_HOME"/wine

I think I will be opening a PR when I have the time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants