-1
I am using netbeans and Maven. When I try to run the jar file in cmd, the error shown is "no major manifest attribute in".
Follow the nbactions.xml code:
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath br.com.swing.Main</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>C:\Users\Fabio\Documents\NetBeansProjects\EnterpretadorQRcode\src\main\java\br\com\swing</exec.workingdir>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath br.com.swing.Main</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
<exec.workingdir>C:\Users\Fabio\Documents\NetBeansProjects\EnterpretadorQRcode\src\main\java\br\com\swing</exec.workingdir>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath br.com.swing.Main</exec.args>
<exec.executable>java</exec.executable>
<exec.workingdir>C:\Users\Fabio\Documents\NetBeansProjects\EnterpretadorQRcode\src\main\java\br\com\swing</exec.workingdir>
</properties>
</action>
</actions>
segue codigo do pom.xml
``` lang-xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Enterpretador</groupId>
<artifactId>EnterpretadorQRcode</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.1stleg</groupId>
<artifactId>jnativehook</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<type>jar</type>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<name>EnterpretadorQRcode</name>
</project>
You could edit the question and put your
pom.xml
?– Victor Stafusa
I managed to put
– Fabio Da Silva Garcia