informatica:linux:java
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
informatica:linux:java [2013/07/03 09:02] – external edit 127.0.0.1 | informatica:linux:java [2018/10/04 08:16] (current) – [SUN JRE via java-package] javi | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
Java JRE Java Runtime Environment Plugin Mozilla Iceweasel | Java JRE Java Runtime Environment Plugin Mozilla Iceweasel | ||
+ | ===== Descarga versiones antiguas de java ===== | ||
+ | http:// | ||
+ | ===== JRE ===== | ||
- | ===== Debian | + | Existen dos alternativas fundamentalmente para Debian: |
- | ==== Icedtea (no me funciona) ===== | + | * OpenJDK |
+ | * Sun Java. Parece ser que la version 7 tiene algun tipo de copyright restrictivo que lo hace incompatible con Debian, por lo que no existe como paquete | ||
- | Instala el JRE (necesario para ejecutar aplicaciones Java) y el plugin web para iceweasel: | + | ==== OpenJDK ===== |
- | sudo aptitude install | + | |
+ | |||
+ | **NOTA**: parece ser que la version 7 no tiene todavia el plugin | ||
==== SUN JRE ===== | ==== SUN JRE ===== | ||
- | 1. Descargar JRE: | + | 1. Descargar |
- | http://www.oracle.com/ | + | https:// |
- | http:// | + | |
- | En mi caso: | + | En mi caso "Linux x64": |
- | jre-7u11-linux-x64.tar.gz | + | http:// |
- | 2. Descomprimir | + | 2. Descomprimirlo |
- | | + | < |
+ | sudo cp /path/to/jre-8u171-linux-x64.tar.gz /opt | ||
+ | cd /opt | ||
+ | sudo tar xfz jre-8u171-linux-x64.tar.gz | ||
+ | sudo ln -s jre1.8.0_171 java | ||
+ | </ | ||
- | 3. Enlazar | + | 3. Instalar la alternativa: |
- | | + | |
- | sudo ln -s | + | |
- | 4. Abrir y cerrar iceweasel | + | 4. Activarla: |
+ | sudo update-alternatives --config java | ||
+ | |||
+ | 5. Seleccionar la entrada que acabamos de crear, en nuestro caso la opción 1: | ||
+ | |||
+ | < | ||
+ | There are 2 choices for the alternative java (providing / | ||
+ | |||
+ | Selection | ||
+ | ------------------------------------------------------------ | ||
+ | 0 / | ||
+ | * 1 / | ||
+ | 2 / | ||
+ | |||
+ | Press < | ||
+ | </ | ||
+ | |||
+ | 6. Comprobar que tenemos la versión de Oracle de java: | ||
+ | |||
+ | java -version | ||
+ | | ||
+ | Salida esperada: | ||
+ | |||
+ | < | ||
+ | java version " | ||
+ | Java(TM) SE Runtime Environment (build 1.8.0_171-b11) | ||
+ | Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode) | ||
+ | </ | ||
+ | |||
+ | ==== SUN JRE via java-package ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | 1. Add a " | ||
+ | |||
+ | < | ||
+ | # Debian 7 " | ||
+ | deb http:// | ||
+ | </ | ||
+ | |||
+ | 2. Update the list of available packages and install the java-package package: | ||
+ | |||
+ | sudo apt-get update && sudo apt-get install java-package | ||
+ | |||
+ | 3. Download the desired Java JDK/JRE binary distribution (Oracle). Choose tar.gz archives or self-extracting archives, do not choose the RPM! | ||
+ | |||
+ | 4. Use java-package to create a Debian package, for example: | ||
+ | |||
+ | make-jpkg jdk-7u45-linux-x64.tar.gz | ||
+ | |||
+ | 5. Install the binary package created: | ||
+ | |||
+ | sudo dpkg -i oracle-j2sdk1.7_1.7.0+update45_amd64.deb | ||
+ | | ||
+ | 6. Hcerlo default | ||
+ | |||
+ | 6.1. Obtener listado: | ||
+ | |||
+ | < | ||
+ | sudo update-alternatives --list java | ||
+ | |||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Y: | ||
+ | |||
+ | < | ||
+ | sudo update-java-alternatives -l | ||
+ | |||
+ | java-1.7.0-openjdk-amd64 1071 / | ||
+ | jdk-8-oracle-x64 318 / | ||
+ | </ | ||
+ | |||
+ | 6.2. Seleccionar: | ||
+ | |||
+ | < | ||
+ | sudo update-alternatives --set java / | ||
+ | sudo update-java-alternatives -s jdk-8-oracle-x64 | ||
+ | </ | ||
+ | |||
+ | ===== Plugin para iceweasel ===== | ||
+ | |||
+ | ==== OpenJDK ===== | ||
+ | |||
+ | Probado en Jessie: | ||
+ | |||
+ | sudo aptitude install icedtea-plugin | ||
+ | |||
+ | ==== SUN JRE ==== | ||
+ | |||
+ | 1. Descargar el JRE de Oracle: | ||
+ | |||
+ | https:// | ||
+ | |||
+ | En mi caso "Linux x64": | ||
+ | |||
+ | http:// | ||
+ | |||
+ | 2. Descomprimirlo en /opt | ||
+ | |||
+ | < | ||
+ | sudo cp / | ||
+ | cd /opt | ||
+ | sudo tar xfz jre-8u171-linux-x64.tar.gz | ||
+ | sudo ln -s jre1.8.0_171 java | ||
+ | </ | ||
+ | |||
+ | 3. Instalar la alternativa: | ||
+ | |||
+ | sudo update-alternatives --install / | ||
+ | |||
+ | 4. Activarla: | ||
+ | |||
+ | sudo update-alternatives --config | ||
+ | |||
+ | 5. Seleccionar la entrada que acabamos de crear, en nuestro caso la opción 1: | ||
+ | |||
+ | < | ||
+ | There are 2 choices for the alternative mozilla-javaplugin.so (providing / | ||
+ | |||
+ | Selection | ||
+ | ------------------------------------------------------------ | ||
+ | 0 / | ||
+ | * 1 / | ||
+ | 2 / | ||
+ | |||
+ | Press < | ||
+ | </ | ||
+ | |||
+ | 6. Cerrar (si está abierto firefox) y volver a abrir | ||
+ | |||
+ | 7. Teclar en la barra de navegación: | ||
+ | |||
+ | about: | ||
+ | | ||
+ | Salida esperada: | ||
+ | |||
+ | < | ||
+ | Java(TM) Plug-in 11.171.2 | ||
+ | |||
+ | File: libnpjp2.so | ||
+ | Path: / | ||
+ | Version: 11.171.2 | ||
+ | State: Enabled | ||
+ | Next Generation Java Plug-in 11.171.2 for Mozilla browsers | ||
+ | |||
+ | MIME Type Description Suffixes | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | </ | ||
===== Error eclipse y java solo debian ===== | ===== Error eclipse y java solo debian ===== | ||
Line 102: | Line 299: | ||
sudo aptitude install libbluetooth-dev | sudo aptitude install libbluetooth-dev | ||
+ | ===== Anyadir certificado a keystore de Firefox ===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | < | ||
+ | keytool -importkeystore -srckeystore / | ||
+ | </ | ||
+ | |||
+ | A continuacion teclear 3 veces **una contrasenya fuerte**, sino obtendreis este error: | ||
+ | |||
+ | < | ||
+ | keytool error: java.io.IOException: | ||
+ | </ | ||
+ | |||
+ | ===== Cambiar máquina de java ===== | ||
+ | ==== Compilando paquete ==== | ||
+ | Nos bajamos el fichero de la máquina java que queremos instalar: | ||
+ | jdk-7u80-linux-x64.tar.gz | ||
+ | Ahora lo tenemos que convertir en paquete debian para poder cambiar como alternativa. | ||
+ | |||
+ | Instalamos java-package. Como usuario no root ejecutamos: | ||
+ | make-jpkg jdk-7u80-linux-x64.tar.gz | ||
+ | Nos crea el paquete: | ||
+ | oracle-java7-jdk_7u80_amd64.deb | ||
+ | | ||
+ | Instalamos el paquete y nos aparece como alternativa. | ||
+ | ==== Descomprimiendo jvm de forma manual ==== | ||
+ | Descomprimimos la JVM en / | ||
+ | |||
+ | Luego lo añadimos como alternativa para java y javac. El último número es la prioridad: | ||
+ | update-alternatives --install / | ||
+ | | ||
+ | update-alternatives --install / | ||
+ | |||
+ | === Cambiando de JVM === | ||
+ | Ahora seleccionamos la nueva jvm: | ||
+ | < | ||
+ | # update-alternatives --config java | ||
+ | Existen 2 opciones para la alternativa java (que provee / | ||
+ | Selección | ||
+ | ------------------------------------------------------------ | ||
+ | 0 / | ||
+ | 1 / | ||
+ | * 2 / | ||
+ | </ |
informatica/linux/java.1372842169.txt.gz · Last modified: 2015/04/13 20:19 (external edit)