Forum Discussion
How to introduce Java commands into PowerShell on Linux platform.
- Apr 04, 2022
fsq2018 The Java program is perhaps not in your path? If you do a write-host $env:PATH, what does it show you? If the path in which Java is located is missing, then you can add it to your Powershell profile by running nano $profile and adding and restart PowerShell to load the adjusted profile:
$env:Path += "/path/to/java"
I think the path should be in your ~/.bash_profile as JAVA_HOME?
fsq2018 The Java program is perhaps not in your path? If you do a write-host $env:PATH, what does it show you? If the path in which Java is located is missing, then you can add it to your Powershell profile by running nano $profile and adding and restart PowerShell to load the adjusted profile:
$env:Path += "/path/to/java"
I think the path should be in your ~/.bash_profile as JAVA_HOME?
- fsq2018Apr 05, 2022Copper ContributorThank you for your reply. I tried $env: path and found that there was no Java path,
while in my ~/.bash_profile file, there is a Java pathThen I modified the powershell profile file$env:path+="/home/fang/.jdk/bin"
then I finally found that it work out.- Apr 05, 2022In Windows it automatically takes the path settings into the powershell session, in Linux it's different so it seems. Good to hear that this works