Received: by 10.66.82.195 with SMTP id k3mr4230670pay.23.1347470348068; Wed, 12 Sep 2012 10:19:08 -0700 (PDT) Received: by 10.68.134.129 with SMTP id pk1mr2219227pbb.13.1347470348043; Wed, 12 Sep 2012 10:19:08 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!4no4816361pbn.1!news-out.google.com!a8ni4572pbd.1!nntp.google.com!4no4816359pbn.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Wed, 12 Sep 2012 10:19:07 -0700 (PDT) In-Reply-To: <784b7374-dd6e-4a35-9f71-07e38e63a972@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 69.28.149.29 References: <08dcc4bb-ac13-4992-b576-1d4f51a28d2e@googlegroups.com> <83333a34-5a38-4199-a83b-db2c2c39658b@googlegroups.com> <734d3450-00d4-45cf-a760-f78a10613945@googlegroups.com> <84caa856-f49b-4ae3-8ae8-e7c5b6579b11@googlegroups.com> <784b7374-dd6e-4a35-9f71-07e38e63a972@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <35098d0e-a381-4113-9cbf-83a441f6049d@googlegroups.com> Subject: Re: How Do I Publish My Working Project (corresponding dot jar doesn't work on other's PCs) From: Lew Injection-Date: Wed, 12 Sep 2012 17:19:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:18680 (unknown) wrote: > System.out.println("Hello 1"); > > I then ran the project on my friend's PC using the Command Prompt and the command: java testing.jar This command tells Java to run a 'main()' method from the class 'testing.jar', which would reside in a class file relative to a classpath element "testing/jar.class". This class does not exist. Therefore > I received the error message: > > Exception in thread "main" java.lang.NoClassDefFoundError: testing/jar Exactly so. > Caused by: java.lang.ClassNotFoundException: testing.jar > ... > Could not find the main class: testing.jar. Program will exit. Solution: Don't tell Java to run a nonexistent class. You need to read the tutorial markspace linked: > Classpath in a jarfile: > > Pay attention. -- Lew