Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

448
Vistas
How to determine which command Netbeans is executing to run the project?

I'm developing an Java application using Netbeans and Maven. I'm struggling a lot to run the project as standalone application. Launching the project from Netbeans is all fine but running the executable jar yields an error (failing to load a data file).

I need to know exactly which command(s) Netbeans is executing to run the application. However, the output window of Netbeans only shows me what the application writes "back". Is there a way to figure out/display the command(s) that Netbeans is using to run the project?

Thanks

EDIT: Running the java application and loading files is not the issue here. I'm able to run the application and the libraries are loading correctly. The issue here is to understand how Netbans runs the application (by looking at the commands that are executed).

about 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Netbeans outputs the command it invokes as the very first line of the output.

I use Netbeans 8.2 and that's how it looks like when I hit big green Run button in maven project:

Netbeans Output

The first line reads (formatted for better readablility):

cd D:\test;
"JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_112" 
"M2_HOME=C:\\Program Files\\apache-maven-3.3.3"
cmd /c "\"\"C:\\Program Files\\apache-maven-3.3.3\\bin\\mvn.cmd\"
    -Dexec.args=\"-classpath %classpath com.test.AppStarter\"
    -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8.0_112\\bin\\java.exe\"
    -Dexec.workingdir=D:\\test\\target\\dist
    -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\"
    -Dfile.encoding=UTF-8
    org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""

From that line I can tell that Netbeans:

  • goes to the project's directory
  • sets environment variables (JAVA_HOME and M2_HOME)
  • then executes cmd that executes mvn (by its full path)
    • with bunch of -D arguments (which specify working directory and AppStarter as a class to execute)
    • and exec-maven- plugin with target exec.
about 4 years ago · Santiago Trujillo Denunciar

0

When NetBeans compiles a program it creates a folder-hierarchy with compiled .class files. When creating a JAR archive ZIPs those into the archive. When executing the program, (or debugging,) NetBeans runs the .class files off the folders, not in the JAR file.

These could cause different problems, like different PATH. This can cause "file not found" errors with relative paths.

about 4 years ago · Santiago Trujillo Denunciar

0

what is your operatingsystem?

windows: then wmic may be the tool, which could show you the complete commandline. you will find examples here command line of process by name

linux: try ps -ef | grep java

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda