[problem help] ~/.bashrc和~/.profile添加环境变量,启动.desktop程序时不生效
Tofloor
poster avatar
ZH
deepin
2024-05-25 14:25
Author

同时在.bashrc和.profile添加的环境变量:

export LSP_JAVA_HOME=/usr/soft/jdk-17.0.11
export JAVA_HOME=/usr/soft/jdk1.8.0_66
export PATH=$PATH:JAVA_HOME/bin:/usr/soft/node/bin
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
source $HOME/.cargo/env

neovide.desktop文件内容:

[Desktop Entry]
Name=neovide
Exec=/usr/soft/nvim/bin/neovide
Icon=/usr/soft/nvim/share/icons/hicolor/128x128/apps/nvim.png
Type=Application

启动neovide.desktop后,打开java文件启动lsp服务时报错,找不到java。在终端内启动neovim正常


在应用商城安装的“IntelliJ IDEA 旗舰版”也存在同样的问题,

在.bashrc和.xsession中添加:

export IDEA_VM_OPTIONS="/usr/soft/idea_crk/vmoptions/idea.vmoptions"
export JETBRAINS_CLIENT_VM_OPTIONS="/usr/soft/idea_crk/vmoptions/jetbrains_client.vmoptions"
export JETBRAINSCLIENT_VM_OPTIONS="/usr/soft/idea_crk/vmoptions/jetbrainsclient.vmoptions"

从桌面启动程序后未加载到这个三个环境变量,在idea.sh中添加才生效

Reply Favorite View the author
All Replies
Feng Yu
deepin
2024-05-25 14:30
#1

当然不生效,这俩是交互式shell加载的配置文件,而desktop不是通过交互式或非交互式shell启动的

Reply View the author
ZH
deepin
2024-05-25 14:33
#2
It has been deleted!
ZH
deepin
2024-05-25 14:34
#3
Feng Yu

当然不生效,这俩是交互式shell加载的配置文件,而desktop不是通过交互式或非交互式shell启动的

我该怎么配置

Reply View the author
neko
Moderator
Ecological co-builder
2024-05-25 15:32
#4
ZH

我该怎么配置

直接新建个启动脚本,把环境变量写到里面执行

Reply View the author
ZH
deepin
2024-05-25 16:43
#5
neko

直接新建个启动脚本,把环境变量写到里面执行

目前只能这么处理了,这个是所有linux桌面版通病,还是deepin中bug

Reply View the author
dxy2020
deepin
2024-05-27 09:56
#6

这里是不是该加个$
image.png

Reply View the author
ZH
deepin
2024-05-30 21:11
#7
dxy2020

这里是不是该加个$
image.png

是的,多谢

Reply View the author