How to run java at the Eclipse prompt

Asked

Viewed 1,575 times

1

I made a code in java and in it I use " r" that only works at the prompt and I would like to know how to run this code at the prompt by the eclipse itself.

1 answer

4


Directly, through the Eclipse, is not possible.
You have to export the application as "Runnable JAR file" and execute it on a command window:

Right-click on your project:
Choosing Runnable JAR file and click on Next.

inserir a descrição da imagem aqui

Select the Launche Configuration and indicate where to save jar.

inserir a descrição da imagem aqui

Click on Finish.

To run open a command window where he kept the jar and execute the following command:

java -jar nomePrograma.jar

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.