i have installed Rocky linux 5 or 6 days ago, just now i have installed VS codium and GCC,GDB & g++, i can code in C language without erros.
but python and java are not working.
i installed python and java using following commands.
Please help me out, i know how to set up envirnomental variables in windows, i am new to linux, i tried couple of articles and youtube videos, nothing seems to working for me.
<pre>[root@device-name ~]# python --version
bash: python: command not found...
[root@device-name ~]# python3 --version
Python 3.6.8
[root@device-name ~]# java --version
bash: java: command not found...
[root@device-name ~]# gcc --version && gdb --version && g++ --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
GNU gdb (GDB) Red Hat Enterprise Linux 8.2-16.el8
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@device-name ~]#
</pre>
if you are running that from Visual Code, then you need to configure Visual Code to use python3 instead of python (that would have been the name for python2 on older systems - python3 is not named python).
> Extensions i am using Code runner, i am installed python extension hoping it would work, still no luck and for some strange reason jupitor extesnion automatically installed.
The python option in the screenshot, has a cog wheel in the bottom right hand corner. Click it, chances are you can change the config there. Either that or search python in the workspace option instead of user option. I use official VS Code, rather than some other version of it, so was much easier to find the config options. You’ll have to search through it, if not, just use official VS Code instead.
if you going to use jdk 11 then use this sudo dnf install java-11-openjdk-devel
by the way if you type dnf install java-11-openjdk- then double tab it will show you many option like the documentation if you want to install it also there demo and src code and other option pick what ever you want
if you going to use jdk 17 the latest LTS version
use this sudo dnf install java-17-openjdk-devel
you can use the same trick in the previous option but with this dnf install java-17-openjdk- then double tab
for jdk 8 use this dnf install java-1.8.0-openjdk
this installation will do the path for you so no need to do anything
and for an idea for java i would go for IntelliJ IDEA: The Capable & Ergonomic Java IDE by JetBrains there community version which is free
for easy way to install that ide and it keep updated use there toolbox JetBrains Toolbox App: Manage Your Tools with Ease it’s appimage app after you download it extract it then set the file to be executable right click on the file then properties then permission then check allow executing file as program then click on it and you good to go
But even the python3 version is quite old. For any serious python development (other than “system” related) it can be useful to create environments using something like miniconda and conda-forge for easy access to modern Python versions and the wealth of packages that go with it.
The base system tools, e.g. dnf, do use their own copy of python that is and always will be python 3.6.
The AppStream, however, does currently provide python 3.8 and 3.9. You can thus have 3.9 as the python that you see, rather than the 3.6. (Well, up to May 2024, when that stream goes EOL. By then there probably is something newer.)