0

So I just installed android studio for PlayOnLinux and it was fine. When I try to start it, it is looking for JAVA_HOME environmental variable to be set to the jdk.

I have the jdk installed in my virtual windows directory as well as on linux. How do I set an environmental variable in PlayOnLinux?

I tried adding export JAVA_HOME=/jdk-installation to .bash.sh and /home/myUser/playonlinux-bash.sh but neither did anything. Is it somewhere in the GUI?

Rmahajan
  • 1,311
  • 1
  • 14
  • 23
kyle
  • 31
  • 5
  • Have you sourced the file applying changes ? – Rmahajan Jan 30 '19 at 17:04
  • I applied the changes if that's what you mean. I feel like my path might possibly be incorrect: export JAVA_HOME=/home/myUser/dosdevices/z:/usr/local/jdk1.8.0_201 – kyle Jan 30 '19 at 17:10
  • Possible duplicate of [How to set java\_home on Windows 7?](https://stackoverflow.com/q/2619584/608639), [what is the reason for the existence of the JAVA_HOME environment variable?](https://stackoverflow.com/q/5102022/608639), etc. – jww Jan 31 '19 at 00:29

2 Answers2

1

For future people trying to figure this out: I don't think /etc/profile affects PlayOnLinux... I finally found the correct file at

          /home/myUser/dosdevices/z:/usr/share/playonlinux/playonlinux 

and added the

          export JAVA_HOME=/home/myUser/.PlayOnLinux/wineprefix/java/drive_c/ProgramFiles/Java/jdk1.8.0_201

I have other problems running android studio but this is for anyone that wants to set environmental variables in PlayOnLinux

kyle
  • 31
  • 5
0

Open file /etc/profile in edit mode

vim /etc/profile

Add below path

export JAVA_HOME="jdk-installation"
export PATH=$JAVA_HOME/bin:$PATH

Source the file for applying the change

source /etc/profile
Rmahajan
  • 1,311
  • 1
  • 14
  • 23