Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!zen.net.uk!dedekind.zen.co.uk!aioe.org!.POSTED!not-for-mail From: emf Newsgroups: comp.lang.java.programmer Subject: Re: NoClassDefFoundError Date: Wed, 09 Jan 2013 01:18:21 -0500 Organization: Aioe.org NNTP Server Lines: 49 Message-ID: References: <50e24bb4$0$283$14726298@news.sunsite.dk> <50ea1641$0$288$14726298@news.sunsite.dk> NNTP-Posting-Host: q0ALVNQQ0ipGALYDIb4tnQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:21236 On 2013-01-06 19:26 Arne Vajhøj wrote: > On 1/6/2013 7:19 PM, emf wrote: >> On 2012-12-31 21:36 Arne Vajhøj wrote: >>> On 12/31/2012 9:24 PM, emf wrote: >>>> After a long time, I tried to create an applet. In eclipse it runs >>>> perfect as an applet, but in the webpage in the browser it gives a >>>> NoClassDefFoundError. >>>> >>>> I even tried my very first program, HelloWorldApplet, but I got again >>>> the same problem. >>>> >>>> What kind of problem is this? Is it a compilation issue? Or is it an >>>> eclipse problem? At this stage I would be happy to have the >>>> HelloWorldApplet run: I feel if I this runs, my other program will run >>>> too. >>> >>> Impossible to say without more info. >>> >>> It could be that the class/jar file is not correctly placed >>> or is not correctly served by the web server. >> >> Thanks everybody for your replies and sorry for not having been more >> specific. I really did not expect to generate such a long thread, this >> is really a lively newsgroup! The problem was that eclipse (that's how >> it is capitalized it in the program's logo) insists on putting all >> classes into packages. When putting an applet in a webpage, the class >> has to be *in a folder with the same name* as it originally was in >> eclipse, and the webpage has to *call it from outside the folder*. I >> considered installing the SDK and compiling the applet without the >> package line on top, because I prefer to have the html and the applet in >> the same folder, but that has its own problems, so at this point since >> the program at last is working in my browser from an html file I count >> my blessings. > > You really should use packages. > > If you switch from deploying many class files to deploying a > single jar file, then you can have that jar file in same dir > as the html file. > > Arne I really can't see why packages are preferable, but the jar option is OK. emf -- It ain't THAT, babe! - A radical reinterpretation https://files.nyu.edu/emf202/public/bd/itaintmebabe.html