Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78C3C10384 for ; Thu, 6 Feb 2014 10:03:47 +0000 (UTC) Received: (qmail 35555 invoked by uid 500); 6 Feb 2014 10:03:43 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 35240 invoked by uid 500); 6 Feb 2014 10:03:42 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 35227 invoked by uid 99); 6 Feb 2014 10:03:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Feb 2014 10:03:41 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=HTML_MESSAGE,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of jarlathreidy@gmail.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Feb 2014 10:03:37 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1WBLng-0001kn-8U for users@maven.apache.org; Thu, 06 Feb 2014 02:03:16 -0800 Date: Thu, 6 Feb 2014 02:03:16 -0800 (PST) From: TenLeftFingers To: users@maven.apache.org Message-ID: In-Reply-To: References: <1391622778030-5783294.post@n5.nabble.com> <52F28A38.4090909@yahoo.com> Subject: Re: Build is successful but can't run? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_303029_26579399.1391680996252" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_303029_26579399.1391680996252 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "You should specify the fully qualified main class eg: com.mycompany.app.App in the mainClass field/parameter to the plugin." "1. the main-class-name was supposed to be your main class" Let me clarify. The entry appears in the manifest as: mainClass: fully.qualified.path.to.MyApp instead of Main-Class: fully.qualified.path.to.MyApp I've changed it in the pom (I thought that the tag was a fixed keyword so I didn't change it there initially). "The classpathPrefix line sets where to look for additional JAR files. It is relative to where you are." So relative to where I execute my java -jar ... command from. Okay, I have that. I'm executing from the directory above (..) the target. "Maven compiles and packages your program into a JAR. It copies all of the supporting JAR files listed in your dependencies into target/lib. Before you run, make sure that target/lib exists and has all of the JAR files you need." Yep, they're all there. Including the jar which contains the class it says it can't load and I can see that that class is present in the jar. "The exec plugin (http://mojo.codehaus.org/exec-maven-plugin/) as Wayne has mentioned is another way to accomplish this. This will help you run from within an IDE or by using mvn exec:exec, but it won't help you package and ship your code out for other users." Once I get this running from the command line, this will be an option that I want to use. I'm still getting ClassNotFoundException though. I'm guessing that since I _can_ see the dependencies that this line must be the culprit: "target/" I'm going to try target/lib now. This is a sample client so packaging isn't too important at this point. Good to know, thank you. On Wed, Feb 5, 2014 at 10:17 PM, Wayne Fay [via Maven] < ml-node+s40175n5783328h45@n5.nabble.com> wrote: > > *Failed to load Main-Class manifest attribute from target/myApp.jar* > > > > I opened the manifest and the *Main-Class* attribute was entered as > > *mainClass.* So I changed it to the former and that got rid of that > error. > > But now I *still *get the original error. > > You should specify the fully qualified main class eg: > com.mycompany.app.App > in the mainClass field/parameter to the plugin. > > Wayne > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://maven.40175.n5.nabble.com/Build-is-successful-but-can-t-run-tp5783294p5783328.html > To unsubscribe from Build is successful but can't run?, click here > . > NAML > -- View this message in context: http://maven.40175.n5.nabble.com/Build-is-successful-but-can-t-run-tp5783294p5783366.html Sent from the Maven - Users mailing list archive at Nabble.com. ------=_Part_303029_26579399.1391680996252--