Advertisement
efxtv

Error: Java installation is either not complete or not correctly set up.

Jun 12th, 2024 (edited)
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | Cybersecurity | 0 0
  1. Error: Java installation is either not complete or not correctly set up.
  2.  
  3. Telegram post https://t.me/efxtv2/3790
  4.  
  5. Step 1: Remove Any Existing Java Installations
  6. $ sudo apt purge openjdk*
  7. $ sudo apt autoremove
  8.  
  9.  
  10. Step 2: Install OpenJDK
  11. $ sudo apt update
  12. $ sudo apt install openjdk-11-jdk openjdk-8-jdk
  13.  
  14.  
  15. Step 3: Verify Java Installation
  16. $ ls /usr/lib/jvm/
  17.  
  18.  
  19. Step 4: Set Up Alternatives
  20. $ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1
  21. $ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 1
  22.  
  23.  
  24. Step 5: Configure the Default Java Version
  25. $ sudo update-alternatives --config java
  26. $ sudo update-alternatives --config javac
  27.  
  28.  
  29. Step 6: Set JAVA_HOME and PATH
  30. $ nano ~/.bashrc
  31. $ export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
  32. $ export PATH=$PATH:$JAVA_HOME/bin
  33.  
  34.  
  35. Step 7: Apply the changes
  36. $ source ~/.bashrc
  37.  
  38.  
  39. Step 8: Verify the Installation Again (still error move to step 9)
  40. $ java -version
  41.  
  42.  
  43. Step 9: Create Symbolic Links Manually
  44. $ sudo rm /usr/bin/java
  45. $ sudo rm /usr/bin/javac
  46.  
  47.  
  48. Step 10: Create new symbolic links
  49. $ sudo ln -s /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/bin/java
  50. $ sudo ln -s /usr/lib/jvm/java-11-openjdk-amd64/bin/javac /usr/bin/javac
  51.  
  52.  
  53. Step 11: Verify again
  54. $ java -version
  55. $ javac -version
  56.  
  57.  
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement