From 6c1ce9a6ec17bb032f13f9042245de101d6cb791 Mon Sep 17 00:00:00 2001 From: Gabriel Felipe Souza Santos Date: Tue, 27 Oct 2026 11:15:58 -0300 Subject: [PATCH] =?UTF-8?q?Ajusta=20plugins=20para=20Java=2017=20e=20alinh?= =?UTF-8?q?a=20pr=C3=A9-requisitos=20de=20JDK.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Permite compilar chat e screencast com JDK 21+ na sala; documentação e check do script citam Java 17 como mínimo. Co-authored-by: Cursor --- README.md | 4 ++-- docs/documentation/00_quickstart.md | 5 +++-- docs/documentation/03_build_ant_netbeans.md | 4 ++-- plugins/chat/nbproject/project.properties | 4 ++-- plugins/screencast/.idea/misc.xml | 2 +- plugins/screencast/nbproject/project.properties | 4 ++-- scripts/pitiupi.sh | 8 ++++++++ 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 56405c6..3d0dff1 100644 --- a/README.md +++ b/README.md @@ -73,12 +73,12 @@ O núcleo carrega **todos os `*.jar`** em `PITIUPI_HOME/plugins`. Detalhes: [pit | Ferramenta | Uso | | --- | --- | -| **JDK** com `javac` | Compilação (OpenJDK **25** recomendado; núcleo Java 17) | +| **JDK** com `javac` | Compilação **Java 17+** (núcleo e plugins usam bytecode 17) | | **Apache Ant** | Módulos NetBeans | | **python3** | Script `scripts/pitiupi.sh` (ler o catálogo) | ```bash -sudo apt install openjdk-25-jdk ant +sudo apt install openjdk-21-jdk ant ./scripts/pitiupi.sh check cd pitiupi && ant test # testes JUnit do núcleo ``` diff --git a/docs/documentation/00_quickstart.md b/docs/documentation/00_quickstart.md index 30c1700..5dacfbf 100644 --- a/docs/documentation/00_quickstart.md +++ b/docs/documentation/00_quickstart.md @@ -2,13 +2,14 @@ ## Pré-requisitos -- **JDK completo** (`java` e `javac`) — OpenJDK 25 recomendado; o núcleo usa `javac.source/target=17`, plugins Ant usam 25. +- **JDK completo** (`java` e `javac`) — **Java 17 ou superior** (17, 21 ou 25). Núcleo e plugins compilam com `javac.source/target=17`. - Apache Ant (`pitiupi`, `plugins/chat`, `plugins/screencast`) Ubuntu / WSL: ```bash -sudo apt install openjdk-25-jdk ant +sudo apt install openjdk-21-jdk ant +# ou: openjdk-17-jdk which javac ant ``` diff --git a/docs/documentation/03_build_ant_netbeans.md b/docs/documentation/03_build_ant_netbeans.md index 07c301a..3a6e05e 100644 --- a/docs/documentation/03_build_ant_netbeans.md +++ b/docs/documentation/03_build_ant_netbeans.md @@ -3,8 +3,8 @@ | Módulo | Build | Java | | --- | --- | --- | | `pitiupi` | Ant | 17 | -| `plugins/chat` | Ant | 25 | -| `plugins/screencast` | Ant | 25 | +| `plugins/chat` | Ant | 17 | +| `plugins/screencast` | Ant | 17 | ```bash cd pitiupi && ant jar diff --git a/plugins/chat/nbproject/project.properties b/plugins/chat/nbproject/project.properties index 45f36e7..18c0c57 100644 --- a/plugins/chat/nbproject/project.properties +++ b/plugins/chat/nbproject/project.properties @@ -47,8 +47,8 @@ javac.modulepath= javac.processormodulepath= javac.processorpath=\ ${javac.classpath} -javac.source=25 -javac.target=25 +javac.source=17 +javac.target=17 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/plugins/screencast/.idea/misc.xml b/plugins/screencast/.idea/misc.xml index 59ad060..0623d9d 100644 --- a/plugins/screencast/.idea/misc.xml +++ b/plugins/screencast/.idea/misc.xml @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/plugins/screencast/nbproject/project.properties b/plugins/screencast/nbproject/project.properties index ef9e717..db63554 100644 --- a/plugins/screencast/nbproject/project.properties +++ b/plugins/screencast/nbproject/project.properties @@ -45,8 +45,8 @@ javac.modulepath= javac.processormodulepath= javac.processorpath=\ ${javac.classpath} -javac.source=25 -javac.target=25 +javac.source=17 +javac.target=17 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/scripts/pitiupi.sh b/scripts/pitiupi.sh index 6ad53fd..40138ce 100755 --- a/scripts/pitiupi.sh +++ b/scripts/pitiupi.sh @@ -240,6 +240,14 @@ check_tools() { registry_python validate printf 'OK plugins.registry.json\n' fi + if command -v javac >/dev/null 2>&1; then + local javac_major + javac_major="$(javac -version 2>&1 | grep -oE '[0-9]+' | head -1)" + if [[ -n "${javac_major}" && "${javac_major}" -lt 17 ]]; then + printf 'ERRO: javac precisa ser Java 17 ou superior (atual: %s)\n' "$(javac -version 2>&1)" >&2 + ok=1 + fi + fi return "${ok}" }