0

I have java project generated in Visual Studio Code (installed addon: Java Extension Pack )

Everything works properly when i work with it using IDE, but i would like to know how to build and run it using only commandline.

I would also like to generate .jar file from my project but I can't find such an option.

Files generated by this project:

.classpath:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

.project

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<projectDescription>
  <name>java_project</name>
  <comment/>
  <projects>
    </projects>
  <buildSpec>
    <buildCommand>
      <name>org.eclipse.jdt.core.javabuilder</name>
      <arguments>
            </arguments>
    </buildCommand>
  </buildSpec>
  <natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
  </natures>
</projectDescription>
pktiuk
  • 235
  • 5
  • 10
  • 1
    In VS Code the most common way for that is to use Maven (the Java Extension Pack is a headless Eclipse via LSP, without the dialogs and wizards of the Eclipse IDE). – howlger Jan 09 '20 at 14:07
  • you could build with maven,and do it in command line,refer to https://stackoverflow.com/a/46727175/10768653 – Leo Zhu Jan 10 '20 at 03:16

0 Answers0