Difference between revisions of "Java JRE install and troubleshooting"

From TaticView
Jump to: navigation, search
(Java JRE install and troubleshooting)
 
(40 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
<div style="float: right;">__TOC__</div>
 
<div style="float: right;">__TOC__</div>
 +
= JAVA JRE install and troubleshooting = <!--T:1-->
  
= Java JRE install and troubleshooting =
 
  
 +
<!--T:2-->
 +
The [[TVCli]] (TaticView command line utility), needs JAVA to be available in station where it will be executed.
  
O [[TVCli]] (utilitário de linha de comando do TaticView), necessita que o estação/servidor tenha o Java disponível para sua execução.
+
<!--T:3-->
 +
The minor JAVA version supported is 8u101.
  
A versão mínima necessária é a versão 8u200, sugerimos sempre ter a versão mais recente da versão 8 instalada por que estas atualizações trazem várias correções de segurança.
+
<!--T:4-->
Podem ser usados  os dois empacotamentos disponíveis, tanto o JRE quanto o JDK.
+
As good practice, we recommend you maintain the JAVA installed updated to last updates available for version 8, because they include security corrections.
  
== Obtendo uma versão atualizada do JAVA ==
+
<!--T:5-->
 +
You can use either JRE or JDK packages.
  
Como o Java é uma linguagem open source, existem vários locais onde podemos obtê-la, alguns destes inclusive exigem uma assinatura anual para poder usá-la comercialmente.
+
== Getting a updated JAVA version == <!--T:6-->
Por isso é importante ler os termos de uso.
 
Sugerimos usar a compilação mantida pela [https://www.eclipse.org/org Eclipse Foundation], que tem boa qualidade, é mantida atualizada e livre, por tanto, não tem problemas de licenciamento.
 
O Java mantida pela [https://www.eclipse.org/org Eclipse Foundation] se chama [https://adoptium.net/ Adoptium], sugerimos usar a versão 8.
 
A instalação é simples, basta seguir o wizard.
 
  
== Instalador do TVCli não encontrou o Java ?==
+
<!--T:7-->
 +
JAVA is an open source language, and therefore there are a lot of different sites, some of them you may need to pay a subscription to use it on business applications.
  
É possível que mesmo com o Java presente (instalado) na estação/servidor o instalador do TVCli não consiga detectá-lo.
+
<!--T:8-->
O Instalador procura o Java em duas variáveis de ambiente, no ''PATH'' do sistema operacional e na variável de ambiente ''JAVA_HOME'', caso o Java não esteja mapeado em nenhuma destas variáveis o instalador aborta a instalção.
+
So, it's very important to read the license before use it.
  
 +
<!--T:9-->
 +
We suggest you to use a build maintained by [https://www.eclipse.org/org Eclipse Foundation], witch maintain a good quality and updates security patches, and it's free for business use.
 +
 +
<!--T:10-->
 +
The JAVA maintained by [https://www.eclipse.org/org Eclipse Foundation] is the  [https://adoptium.net/about.html Adoptium].
 +
 +
<!--T:11-->
 +
[[File:Filesave.png]]
 +
[https://adoptium.net/ DOWNLOAD JAVA 8 updated version] from Eclipse Foundation.
 +
 +
<!--T:12-->
 +
And install it, it's very simple using the install wizard.
 +
 +
== TVCli installer didn't found JAVA ?== <!--T:13-->
 +
 +
<!--T:14-->
 +
It is possible the even with JAVA installed on the station, the TVCli installer can't find it.
 +
 +
<!--T:15-->
 +
The installer search the folder where JAVA is installed, by reading two [https://en.wikipedia.org/wiki/Environment_variable environment variables]:
 +
* At ''JAVA_HOME'' environment variable
 +
* At Windows [https://en.wikipedia.org/wiki/PATH_(variable)#DOS,_OS/2,_and_Windows ''PATH'']
 +
In cases where JAVA isn't mapped in any of these variables, the installer aborts the installation and shows the following screen.
 +
 +
<!--T:16-->
 
[[File:Java_not_found_by_installer.png]]
 
[[File:Java_not_found_by_installer.png]]
  
Vamos ajudá-lo a configurar a variável de ambiente ''PATH''
+
<!--T:17-->
 +
Next, we'll help you set the ''PATH'' environment variable to solve this problem.
 +
 
 +
=== Configuring Windows ''PATH'' === <!--T:18-->
  
=== Configurando o ''PATH'' no Windows ===
+
<!--T:19-->
 +
The first step is to locate the folder where JAVA is installed on the workstation. This can be done by looking for ''java.exe'' in the machine's folders, if you have more than one JAVA on the workstation, the ideal is to use the latest update from version 8.
  
O primeiro passo é localizar a pasta onde o Java está instalado na estação, isso pode ser feito procurando por ''java.exe'',
+
<!--T:20-->
caso vc tenha mais de um Java na estação o ideal é usar a atualização mais recente da o da versão 8.
+
The second step is to configure the environment variable so that it ''points'' to the directory located in the first step.
 +
# From the Windows Start menu, click Control Panel.
 +
# In Control Panel, double-click System.
 +
# In the System Properties dialog, click the Advanced tab and click Environment Variables.
 +
# In the Environment Variables dialog, in the System Variables frame, select the ''Path'' entry.
 +
# Edit button
 +
# Check if there is already an entry pointing to some old JAVA directory, if so, remove it.
 +
# New button
 +
# Enter the path to the JAVA ''bin'' directory (where the ''java.exe'' file is)
 +
# OK button
 +
# Rerun the installer
  
* No menu Iniciar , clique em Painel de Controle.
+
== Error UnsupportedClassVersionError when running TVCli == <!--T:25-->
* No Painel de Controle, clique duas vezes em Sistema.
 
* Na caixa de diálogo Propriedades do Sistema , clique na guia Avançado e clique em Variáveis de Ambiente.
 
* Na caixa de diálogo Variáveis de Ambiente , no quadro Variáveis do sistema ,selecione a entrada ''Path''.
 
  
 +
<!--T:26-->
 +
The '''UnsupportedClassVersionError''' happens because the Java version in use isn't correct.
  
    On the Start menu, click Control Panel.
+
<!--T:27-->
    In Control Panel, double-click System.
+
Bellow a complete sample of the error output
    In the System Properties dialog box, click the Advanced tab, and then click Environment Variables.
+
<pre>
    In the Environment Variables dialog box, in the System variables frame,select the ''Path'' entry.
+
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/sadig/taticview/cli/Main : Unsupported major.minor version 52.0
 +
        at java.lang.ClassLoader.defineClass1(Native Method)
 +
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
 +
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 +
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
 +
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
 +
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
 +
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 +
        at java.security.AccessController.doPrivileged(Native Method)
 +
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 +
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
 +
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
 +
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
 +
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
 +
</pre>
 +
The Java used during TVCli execution is indicated by Windows [https://en.wikipedia.org/wiki/PATH_(variable)#DOS,_OS/2,_and_Windows ''PATH''] variable.
  
 +
<!--T:28-->
 +
To determine witch version of Java is pointed by PATH variable you can use the JAVA ''-version'' parameter, we will show you bellow.
 +
# Open [https://en.wikipedia.org/wiki/Windows_Console Windows Command Console]
 +
# Execute java asking for his version:  '''''java -version'''''
  
* Botão Editar
+
<!--T:29-->
* Verificar se já existe uma entrada apontando para algum diretório antigo do Java, se sim, remova.
+
The ''-version'' parameter should output something like bellow for Java version 8
* Botão Novo
+
<pre>
* Digite o caminho para diretório BIN do Java (onde está o arquivo ''java.exe'')
+
C:\>java -version
* Botão OK
+
openjdk version "1.8.0_282"
* Reexecute o instalador
+
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08)
 +
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode)
 +
</pre>
  
== Mais dúvidas ? ==
+
<!--T:30-->
 +
If Java version is bellow 8 the ''UnsupportedClassVersionError'' is thrown. You need to install a newer version, or if a newer version is already installed, you need to [[#Configuring_Windows_PATH|correct de Windows PATH]] variable to point to newest Java.
  
Caso ainda tenha dúvidas fale com nosso [https://support.taticview.com/ Suporte], podemos lhe ajudar no que for necessário.
+
== More doubts ? == <!--T:23-->
  
 +
<!--T:24-->
 +
If you still have questions, talk to us through [https://support.taticview.com support], we can help you with whatever you need.
  
 
</translate>
 
</translate>

Latest revision as of 14:52, 5 October 2022

Other languages:
English • ‎português do Brasil


JAVA JRE install and troubleshooting

The TVCli (TaticView command line utility), needs JAVA to be available in station where it will be executed.

The minor JAVA version supported is 8u101.

As good practice, we recommend you maintain the JAVA installed updated to last updates available for version 8, because they include security corrections.

You can use either JRE or JDK packages.

Getting a updated JAVA version

JAVA is an open source language, and therefore there are a lot of different sites, some of them you may need to pay a subscription to use it on business applications.

So, it's very important to read the license before use it.

We suggest you to use a build maintained by Eclipse Foundation, witch maintain a good quality and updates security patches, and it's free for business use.

The JAVA maintained by Eclipse Foundation is the Adoptium.

Filesave.png DOWNLOAD JAVA 8 updated version from Eclipse Foundation.

And install it, it's very simple using the install wizard.

TVCli installer didn't found JAVA ?

It is possible the even with JAVA installed on the station, the TVCli installer can't find it.

The installer search the folder where JAVA is installed, by reading two environment variables:

  • At JAVA_HOME environment variable
  • At Windows PATH

In cases where JAVA isn't mapped in any of these variables, the installer aborts the installation and shows the following screen.

Java not found by installer.png

Next, we'll help you set the PATH environment variable to solve this problem.

Configuring Windows PATH

The first step is to locate the folder where JAVA is installed on the workstation. This can be done by looking for java.exe in the machine's folders, if you have more than one JAVA on the workstation, the ideal is to use the latest update from version 8.

The second step is to configure the environment variable so that it points to the directory located in the first step.

  1. From the Windows Start menu, click Control Panel.
  2. In Control Panel, double-click System.
  3. In the System Properties dialog, click the Advanced tab and click Environment Variables.
  4. In the Environment Variables dialog, in the System Variables frame, select the Path entry.
  5. Edit button
  6. Check if there is already an entry pointing to some old JAVA directory, if so, remove it.
  7. New button
  8. Enter the path to the JAVA bin directory (where the java.exe file is)
  9. OK button
  10. Rerun the installer

Error UnsupportedClassVersionError when running TVCli

The UnsupportedClassVersionError happens because the Java version in use isn't correct.

Bellow a complete sample of the error output

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/sadig/taticview/cli/Main : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

The Java used during TVCli execution is indicated by Windows PATH variable.

To determine witch version of Java is pointed by PATH variable you can use the JAVA -version parameter, we will show you bellow.

  1. Open Windows Command Console
  2. Execute java asking for his version: java -version

The -version parameter should output something like bellow for Java version 8

C:\>java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode)

If Java version is bellow 8 the UnsupportedClassVersionError is thrown. You need to install a newer version, or if a newer version is already installed, you need to correct de Windows PATH variable to point to newest Java.

More doubts ?

If you still have questions, talk to us through support, we can help you with whatever you need.