0
Oops, I ran a java application, now I need to get the executable .jar. How do I get the . jar in VS Code?
0
Oops, I ran a java application, now I need to get the executable .jar. How do I get the . jar in VS Code?
1
Hello, you can use the command:
jar cf jar-file input-file(s)
Where input-file(s) are the classes you want in the jar. The visual code has a built-in terminal.
Thanks Bruno... I will perform this test here
0
If you have an updated version of Visual Studio Code you can configure in task.json
.
First you need to create a "project folder", click the button Add workspace
, as in the image:
java-teste
It will generate a standard template, like this:
{
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "echo Hello"
}
]
}
You can customize and add the javac
to create the .class
and then the jar cf <nome do jar>
to create the .jar
Note that .jar
is not an executable, but a package, as if it were an installer or something, if what you want is just to run your script you can install an extension, follows one that is made for this:
Thanks William. I will perform this test... Sorry the delay in returning
Browser other questions tagged java visual-studio-code
You are not signed in. Login or sign up in order to post.
Possible duplicate or related:How to create a file . jar appropriately?
– user28595
The
VSCODE
is unrelated to the generation of.jar
. You’re looking for an automated way, that’s it?– Marcelo de Andrade
Which plugin you use to compile and run Java code in VS Code?
– Jéf Bueno
Oops, Marcelo understood I thought there was some way, I know by netbeans
– TMura
Both the netbeans and the eclipse use the ant to automate the creation of jars, but in netbeans, it takes care of configuring build.xml, and in eclipse this does not always occur and sometimes it is necessary to configure manualment.
– user28595
Articuno - More in VS Code would have some possibility to get this executable?
– TMura
LINQ - I don’t use any at the moment I’m wanting to find out, I saw that it has a Manven plugin
– TMura