You Are Here:

Community: Developer Discussion Boards

#1 Old noClassDefFoundError Hello - 2002-05-27, 15:59

Join Date: Mar 2003
Posts: 2,428
Nokia_Archive
Offline
Super Contributor
I have seen posts from other people with the same problem but no answers have been posted so far. So I am reposting and hopefully some Nokia or Symbian support people ever read this message board, probably not.

I installed the Symbian SDK for Personal Java for the Nokia Communicator on my Windows XP. Btw, the installation failed twice because it couldn't execute a remote procedure call during
the installation (I guess some Symbian server was down) - that's ridiculous, Symbian should rethink their installation strategy, seriously.
The third time it installed fine and now I am trying to run the Hello World example that comes with the SDK.
That's where I get java.lang.noClassDefFoundError
my EPOCROOT path is \Symbian\6.0\NokiaJava as it should be. Apparently, EPOCROOT\erj gets mapped to the J: drive, which is supposedly the virtual path for the emulator, so that a directory Hello created at EPOCROOT\erj can be addressed with J:/Hello or possibly J:\Hello, I tried both for the heck of it.
So I copied the Hello.java from Symbian's QuickStart manual and compiled it. Then I ran:
c:\Symbian\6.0\NokiaJava\Epoc32\Release\wins\urel\pjava -cp J:/Hello Hello
with the result:
java.lang.NoClassDefFoundError Hello

I also tried
pjava -v -classpath
"J:/lib/classes.zip;J:/Hello" Hello

and all the java classes in classes.zip get loaded, but it still doesn't find the Hello.class

I have seen two other posts describing the same problem.

Posted by A. Wallner, aw@webradios.com
on April 25, 2002 at 21:08

#2 Old RE: noClassDefFoundError Hello - 2002-05-27, 15:59

Join Date: Mar 2003
Posts: 2,428
Nokia_Archive
Offline
Super Contributor
Posted by Alexander Hariyanto, alexander.hariyanto@sanur-online.com
on April 30, 2002 at 13:31



Hi, there

I've experienced the same problem with you, but I have managed to make it work.

Have you compile your .java file ? It should become two .class file in your folder
c:\Symbian\6.0\NokiaJava\erj\Hello

then try again
c:\Symbian\6.0\NokiaJava\Epoc32\Release\wins\urel\pjava -cp J:\Hello Hello

It should work.
If the emulator does show up, and nothing happen, try to add these lines in the main function:

try
{ Thread.sleep(60000);
} catch(InterruptedException ie) { }
Hello hi = new Hello();

#3 Old RE: noClassDefFoundError Hello - 2002-06-26, 04:09

Join Date: Mar 2003
Posts: 2
silent_hound
Offline
Registered User
i have encountered the same problem, and yes, nobody seems to know why it's like this, not even nokia. my os is win xp, and my epocroot is at c:\programs\symbian\6.0\nokiajava. i have also tried it with the examples, specifically blackbook. i tried to open it from the emulator but it crashes. the emulator interface appears but closes immediately. the message is that there was an "exception in thread 'main' java.lang.NoClassDefFoundError: BlackBook", or as in the case of the hello ap, "exception in thread 'main' java.lang.NoClassDefFoundError: Hello".

what on earth is happening?

i have compiled the source files and i have the corresponding .class files in the erj\Hello directory.

#4 Old RE: noClassDefFoundError Hello - 2002-11-20, 18:15

Join Date: Mar 2003
Posts: 4
edwyr
Offline
Registered User
I had this problem and I realized that using j2sdk1.4.1_01/bin/javac to compile the *.java files was generating byte codes for a different jvm. When I added -target 1.1 (javac -target 1.1) to the command it worked. Now I have a different problem. :(

#5 Old Use SDK 1.1.8 and the right path - 2003-06-14, 03:12

Join Date: Jun 2003
Posts: 6
peterammel
Offline
Registered User
I had exactly the same problem, using the jdk-1_4_1_03.

Then I removed this jdk and installed the sdk 1.1.8 (download at http://java.sun.com/products/archive/index.html).


And it's also important that you put your .class files in the right subfolder of apps:
C:\Symbian\6.0\NokiaJava\erj\system\apps\Helloworld
=> put the Helloworld.class directly into this folder

After standart installation the default classpath using wildcards is:

c:\Symbian\6.0\NokiaJava\erj\
=> j:/ [the drive of the emulator]

So if you want to start the Helloworld-Program just say:
pjava -cp j:/system/apps/Helloworld Helloworld

Now it should work!

Last edited by peterammel : 2003-06-14 at 13:07.

#6 Old 2003-08-21, 11:20

Join Date: Mar 2003
Posts: 7
Location: Lahore, Pakistan
siddiq's Avatar
siddiq
Offline
Registered User
Make sure that you set the following environment variable:
_epoc_drive_j

If it points to lets say "c:\Symbian\6.0\NokiaJava\erj\"

Then you should keep your class files or jar file in that folder. so it will become

c:\Symbian\6.0\NokiaJava\erj\Hello\helloapp.jar
or
c:\Symbian\6.0\NokiaJava\erj\Hello\Hello.class


Now you run the emulator like this:
pjava -cp j:\Hello\helloapp.jar Hello

Thats all.
The key is to match the path carefully. The emulator will find your application here <_epoc_drive_j>\Hello\Hello.class

Good luck!
  « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d5632X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZjavaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxjavaX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ