jdk.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!DOCTYPE html>
  2. <!--
  3. Autor : Herley Ramos
  4. Data : 22/12/2017
  5. Projeto: Dicas
  6. Meta : Organizar as dicas do JDK (agora neste html, antes em OOo)
  7. -->
  8. <?php
  9. include("cabecalho.php");
  10. ?>
  11. <section>
  12. <!--InstalarJDK-->
  13. <h1>JDK e Painel Java no Debian <span style="font-family: 'Noto Sans', sans-serif;">9.3</span> Stretch</h1>
  14. <h1>e no Debian <span style="font-family: 'Noto Sans', sans-serif;">10</span> Buster</h1>
  15. <h2>Instalando JDK</h2>
  16. <h3>JDK Oracle 8 update 152</h3>
  17. <h4>Procedimento</h4>
  18. <div class="box sombra">
  19. Faça download do <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" target="_blank" class="a">JDK8</a>
  20. salvando em:<br/>
  21. /home/$USER/Downloads/Desenvolvedor/jdk-oracle/jdk-8u152-linux-x64.tar.gz<br/>
  22. </div>
  23. <h3>Extrair o Java Developer Kit (JDK) e renomear</h3>
  24. <h4>Código</h4>
  25. <div class="box sombra">
  26. $ cd /home/$USER/Downloads/Desenvolvedor/jdk-oracle/<br/>
  27. $ tar xvzf jdk-*.tar.gz<br/>
  28. $ mv jdk1*/ jdk-oracle<br/>
  29. </div>
  30. <h3>Copiar o JDK ao local definitivo e informar ao linux as pastas de trabalho</h3>
  31. <h4>Código</h4>
  32. <div class="box sombra">
  33. $ su<br/>
  34. # cp -rp jdk-oracle /usr/lib/jvm && rm -r jdk-oracle/<br/>
  35. # update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/bin/java" 1<br/>
  36. # update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/bin/javac" 1<br/>
  37. # update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/bin/jar" 1<br/>
  38. # update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/bin/javaws" 1<br/>
  39. </div>
  40. <h3>Definir o JDK 8 up.152 como padrão</h3>
  41. <h4>Código</h4>
  42. <div class="box sombra">
  43. # update-alternatives --set java /usr/lib/jvm/bin/java<br/>
  44. # update-alternatives --set javac /usr/lib/jvm/bin/javac<br/>
  45. # update-alternatives --set jar /usr/lib/jvm/bin/jar<br/>
  46. # update-alternatives --set javaws /usr/lib/jvm/bin/javaws<br/>
  47. </div>
  48. <h3>Incluir as variáveis de ambiente</h3>
  49. <h4>Código</h4>
  50. <div class="box sombra">
  51. # vim /etc/profile<br/>
  52. </div>
  53. <h3>Va até o final do arquivo e inclua as seguintes linhas</h3>
  54. <h4>Incluir no arquivo</h4>
  55. <div class="box sombra">
  56. JAVA_HOME=/usr/lib/jvm<br/>
  57. PATH=$PATH:$HOME/bin:$JAVA_HOME/bin<br/>
  58. export JAVA_HOME<br/>
  59. export PATH<br/>
  60. </div>
  61. <h3>Reiniciar e testar</h3>
  62. <h4>Código</h4>
  63. <div class="box sombra">
  64. # reboot<br/>
  65. $ java -version<br/>
  66. $ javac -version<br/>
  67. </div>
  68. <h3>Referências</h3>
  69. <h4>Links</h4>
  70. <div>
  71. <a href="https://stackoverflow.com/questions/14788345/how-to-install-jdk-on-ubuntu-linux" class="a" target="_blank">https://stackoverflow.com/questions/14788345/how-to-install-jdk-on-ubuntu-linux</a><br/><br/>
  72. <a href="http://stackoverflow.com/questions/24641536/how-to-set-java-home-in-linux-for-all-users" class="a" target="_blank">http://stackoverflow.com/questions/24641536/how-to-set-java-home-in-linux-for-all-users</a><br/><br/>
  73. <a href="https://devjava.wordpress.com/2014/01/21/env-002-instalacao-e-configuracao-da-jvm-e-jdk/" class="a" target="_blank">https://devjava.wordpress.com/2014/01/21/env-002-instalacao-e-configuracao-da-jvm-e-jdk/</a><br/><br/>
  74. <a href="https://devjava.wordpress.com/2014/01/16/variaveis-de-ambiente-em-linux/" class="a" target="_blank">https://devjava.wordpress.com/2014/01/16/variaveis-de-ambiente-em-linux/</a><br/><br/>
  75. <a href="http://askubuntu.com/questions/20953/sudo-source-command-not-found" class="a" target="_blank">http://askubuntu.com/questions/20953/sudo-source-command-not-found</a><br/>
  76. </div>
  77. <?php
  78. include("pre-rodape.php");
  79. ?>
  80. <!--Panel Java-->
  81. <h2>Instalando o Acesso ao Painel de Controle do Java</h2>
  82. <h3>Criando atalhos dos menús</h3>
  83. <h4>Código</h4>
  84. <div class="box sombra">
  85. <span class="b">$ sudo tee /usr/share/applications/java-control.desktop <<</span><span class="b">ATALHO<br/>
  86. [Desktop Entry]<br/>
  87. Encoding=UTF-8<br/>
  88. Name=Java<br/>
  89. Comment=Java Control Panel<br/>
  90. Exec=sh '/usr/lib/jvm/bin/jcontrol'<br/>
  91. Icon=/usr/lib/jvm/jre/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png<br/>
  92. Terminal=false<br/>
  93. Type=Application<br/>
  94. Categories=Development;Settings;Java;<br/>
  95. ATALHO</span>
  96. </div>
  97. </section>
  98. <?php
  99. include("rodape.php");
  100. ?>