Jump to content
  • Advertisement
Sign in to follow this  
namingway

[java] [SOLVED]

This topic is 3563 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've encountered an error I've never come across before, when I go to run an applet through a web browser the console gives me this output. load: class Main.class not found. java.lang.ClassNotFoundException: Main.class at sun.applet.AppletClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadCode(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) I have no idea why it can't find the Main class since it works fine in the netbeans applet viewer. Here's how I've got the applet tag. '<applet archive='CityBuilder.jar' code='Main.class' width='800' height='600'></applet>' How can I fix this problem? -Regards Namingway [Edited by - namingway on January 15, 2009 5:51:53 PM]

Share this post


Link to post
Share on other sites
Advertisement
this i just a wild guess but the only time i've seen that specific error is when the default JRE on the System is incompatible with the applet/application im trying to run. for example if the application/applet requires 1.6 but the System's default JRE is 1.4, you might encounter that problem

Share this post


Link to post
Share on other sites
wel if that realy is the problem you would need to install the latest version of java on your system

http://java.sun.com/javase/downloads/index.jsp

i'd reccommend Java SE Development Kit (JDK) 6 Update 11

you wil also need to make sure that your browser does not by default use the older version of java. the simplest way to do this is by uninstalling any older version of java

Share this post


Link to post
Share on other sites
the only other thing i can think of is that your browser if having trouble reading the JAR archive. the archive might have incorrect meta data.
try not using a archive and see if that works

change

'<applet archive='CityBuilder.jar' code='Main.class' width='800' height='600'></applet>'

to

'<applet code='Main.class' width='800' height='600'></applet>'

and then make sure the Main.class and everything else that was in your JAR archive is in the same folder as the html file that contains the applet tag

if it works like that the problem lies with the JAR archive and steps can taken from there to fix it, if not then i honestly have no idea what could be causing it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!