This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Spark in Action and have Jean-Georges Perrin on-line!
See this thread for details.
Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

problem with applet

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a small applet program as follows:
import java.applet.*;
import java.awt.*;
public class FirstApplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("hello world",25,50);
}
}
It compiled fine. But when I run the program it gives the following error:
C:\jdk1.2.2\bin\java.exe
Working Directory - D:\shrividya\myprogs\
Class Path - C:\jdk1.2.2\lib\tools.jar;.;d:\kawa\kawaclasses.zip;c:\jdk1.2.2\jre\lib\rt.jar;c:\jdk1.2.2\jre\lib\i18n.jar
Usage: java.exe [-options] class [args...]
(to execute a class)
or java.exe -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-? -help print this help message
-X print help on non-standard options
Process Exit...
in the Kawa editor.
What should I do to resolve this error???
Thanks,
Vids
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think you are trying to execute an applet using java.exe which is used to execute applications written in java.
Try to execute the applet using an Applet Viewer or open it in a browser as part of a HTML file in the <applet> </applet> tags.
Reply back if this solves the problem.
Prabhu.V.C
 
Prabhu Chandrasekaran
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think you are trying to execute an applet using java.exe which is used to execute applications written in java.
Try to execute the applet using an Applet Viewer or open it in a browser as part of a HTML file in the "<applet> </applet>" tags.
Reply back if this solves the problem.
Prabhu.V.C
 
Vids
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was a small mistake in classpath. In customize-options of Kawa editor I had to give the path for Java lib Directory as "C:\jdk1.2.2\lib" for which I had given as "c:\jdk1.2.2\lib". After correction the problem is solved.
Thanks,
Vids
 
Everybody's invited. Even this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic