Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

429
Views
¿Cómo cerrar jshell al final del script?

¿Cómo indicar a jshell que termine al final del script de manera similar a los intérpretes de otros idiomas como, por ejemplo python3 o node ?

siguiendo el comando

 ./jshell -q /tmp/shell.java

con la secuencia de comandos /tmp/shell.java

 System.out.println("Hello world");

huellas dactilares

 Hello world jshell>

y espera más órdenes. Me gustaría que se detuviera inmediatamente al final del archivo.

Estoy buscando algo más elegante que System.exit(0); al final del guión.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Dentro del script, use el comando jshell /exit . Esto cerrará jshell al final de su secuencia de comandos.

Consulte esta referencia https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm#JSHEL-GUID-465BA4F5-E77D-456F-BCB7-D826AC1E18AE

about 4 years ago · Santiago Trujillo Report

0

Otra posibilidad es tener un archivo de salida:

exit.jsh

 /exit

Y luego ejecuta:

 ./jshell --startup myscript.jsh --startup exit.jsh
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!