473,661 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error while running Applet

58 New Member
Hi All

I got a problem in running java programs.

i am not able to run java applet while running i got a problem as
Loading Java Applet Failed

java.lang.NoCla ssDefFoundError : App (wrong name: src/App)
at java.lang.Class Loader.defineCl ass1(Native Method)
at java.lang.Class Loader.defineCl ass(Unknown Source)
at java.security.S ecureClassLoade r.defineClass(U nknown Source)
at sun.applet.Appl etClassLoader.f indClass(Unknow n Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.applet.Appl etClassLoader.l oadClass(Unknow n Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.applet.Appl etClassLoader.l oadCode(Unknown Source)
at sun.applet.Appl etPanel.createA pplet(Unknown Source)
at sun.plugin.Appl etViewer.create Applet(Unknown Source)
at sun.applet.Appl etPanel.runLoad er(Unknown Source)
at sun.applet.Appl etPanel.run(Unk nown Source)
at java.lang.Threa d.run(Unknown Source)

myhtml file is like this

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  
  3. <head>
  4.  
  5.  
  6. <title>My Applet</title>
  7.  
  8.  
  9.  
  10. </head>
  11.  
  12.  
  13. <body>
  14.  
  15. <h1>Network Applet</h1>
  16.  
  17. <APPLET CODE="App.class" CODEBASE = "\src"  WIDTH=200 HEIGHT=50>
  18.  
  19.  
  20. </APPLET>
  21.  
  22.  
  23.  
  24. </body>
  25.  
  26. </html>
  27.  

the App.java file is



App.java



Expand|Select|Wrap|Line Numbers
  1.  
  2. package src;
  3.  
  4.  
  5.  
  6. import java.awt.*;
  7.  
  8. import java.applet.*;
  9.  
  10. import javax.swing.JApplet;
  11.  
  12. public class App extends JApplet
  13.  
  14. {
  15.  
  16. public void paint(Graphics g)
  17.  
  18. {
  19.  
  20. g.drawString("Hello",100,100);
  21.  
  22. }
  23.  
  24.  
  25. }
  26.  
  27.  
I kept the html file and App.class file in src directory...
so that i specified the CODEBASE in html file like CODEBASE = "\src"
i changed this in so many ways also but no use
i specified complete path of .class file also but it was not run for me..

my directory structure is

src----
app.java
app.class
myhtml.html

Iam using ant to build application so that i also set path to ant...



my jdk path settings are



CLASSPATH

C:\j2sdk1.4.2_1 2\bin;C:\j2sdk1 .4.2_12\lib;





path

C:\ant\bin;C:\j 2sdk1.4.2_12\bi n;



JAVA_HOME

C:\j2sdk1.4.2_1 2



ANT_HOME

C:\ant

can anybody help me...
Mar 8 '07 #1
0 1475

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2891
by: Jeff T. | last post by:
I have an applet that sizes itself to the size of the browser frame that it is running in. On IE the applet resizes upon dragging the frame divider. I'm having a problem with getting this applet to resize itself when I resize the html frame if it's in Netscape 7.x. Seems like the problem is the lack of a refresh signal to the java applet from the page. Is this a known bug, is there a workaround? Thanks. -Jeff
3
3705
by: Al | last post by:
I've been attempting to run a small java applet via a cron on linux with the following command: 50 * * * * /home/usr/java/program/;java runScript I know runScript is running but the gui never pops up, what am I doing wrong? Thanks in advance
2
4838
by: David Haga | last post by:
How can I query an applet from Javascript to determine when it is running? I need to start a second applet but only when I know the first applet is completely loaded, initialized and executing.
5
7813
by: azgoddess1 | last post by:
During the installation I get these error messages: ***** SQL1390C The environment variable DB2Instance is not defined or is invalid An error ocured while loading the command "C:\Program Files\IBM\SQLLIB\bin\db2.exe CREATE TOOLS CATALOG SYSTOOLS USE EXISITING DATABASE DWCTRLDB FORCE" to initialize and\or migrate the DB2 tools catalog database. The return value is "5104".
1
1512
by: rajesh | last post by:
var fixedX = -1 // x position (-1 if to appear below control) var fixedY = -1 // y position (-1 if to appear below control) var startAt = 0 // 0 - sunday ; 1 - monday var showWeekNumber = 0 // 0 - don't show; 1 - show var showToday = 1 // 0 - don't show; 1 - show var imgDir = "images/" // directory for images ... e.g. var imgDir="/img/" var gotoString = "Go To Current Month" var todayString = "Today is" var weekString = "Wk"
1
1499
by: jindalily | last post by:
Hey guys, I wasn't completely sure if this would be a Java or JS topic, but I thought it had more to do with Ajax and whatnot. Anyway, I have an embedded and signed Java applet on my page like so: <applet style="position:absolute;left:-1px" code="fileSaver.class" archive="SignedFileSaver.jar" width="1" height="1"></applet> this applet's jar is signed, and it requests to get file access privilages. the actual function is called from an...
7
1506
by: adrian.bartholomew | last post by:
Im getting an error: Error: unterminated string literal Source File: http://98.214.38.110/allfours/site_flash/2.php Line: 75, Column: 37 Source Code: if (_ie == true) document.writeln(' ___________________________________
0
1026
by: gotnspikes | last post by:
I am trying to create an applet using SitePad Pro. I am a college student and have a lab where I need to create applets. I did it in class just fine. I tried to run a "Hello World!" applet and it isn't working from my home computer. I even tried running an applet example from SitePad and it doesn't work either. The code I try is: import java.awt.*; import javax.swing.JApplet; public class Greeting extends JApplet { public void...
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7364
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1986
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.