Exactly how to run sample Applets
First, let me say exactly what I have done: I unzipped the Solaris version of the Java Card Development Kit on my machine. I then downloaded and unzipped the walletdemo. I opened two terminals and in one typed: jcwde -p 9025 jcwde.app and got the appropriate message. In the other, I typed: apdutool walletApp.scr and got: Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/PortInUseException. What does this mean? I don't have the regular JDK installed, does that matter? How do I run one of the sample applets that came with JCDK?
Thanks
Hello ! Did you compiled the Wallet.java File ya you need java 1.3 for running the .java file .
Neelesh
[email protected]
Similar Messages
-
How to run an Applet using the JDK1.3.1 platform?
I'm a beginner of Java Applet.
I've type in the sample program provided in the text book, and compiled it using the jdk1.3.1 platform.
Usually we run a java program using java [filename], right?
How about running an applet file?
What is appletviewer function?
Thanks!I try to put it in a HTML page but it required me to download a Java Virtual Machine.
I've been searching sources for that but stil cannot get.
This is always what I get:
[We're sorry, you cannot view this page because it requires the Microsoft Java Virtual Machine (MSJVM). Your machine does not have the MSJVM installed. For more information please visit www.microsoft.com/java.]
I visit java.sun.com. On the right side of the page listed with the HOT DOWNLOADS.
I click on the Java VM but still cannot get anything...
Can u help me on that?
I've been trying for 2 days already.
Thanks! -
HOw to run the Applet in dos mode
how to run the applet in Command Prompt(DOS).
I have save this in directory D/vijay/javap/A.java and my JDK is in C drive.
Plz send me reply as soon as possible.
My code is :-
import java.applet.*;
import java.awt.*;
public class A extends Applet
private int w, h;
public void init( )
w = 45;
h = 50;
public void paint(Graphics g)
g.drawRect(w, h, 20, 80);
}import java.applet.*;
import java.awt.*;
public class A extends Applet
private int w, h;
public void init( )
w = 45;
h = 50;
public void paint(Graphics g)
g.drawRect(w, h, 20, 80);
<applet class="A" height="200" width="200" code="A.class">
</applet>
*/And in command prompt
javac A.java
appletviewer A.java
Message was edited by:
passion_for_java -
Trying to run sample applet 'Wallet'. What is PIN?
Dear
I'm trying to run sample applet 'Wallet' in java card development kit.
I have 2 questions.
1) I successfully upload 'cap file'. but I got an error when I install it.
I don't know why.
Below is the APDU
cm> upload "C:\wallet.cap"
=> 80 E6 02 00 16 09 77 61 6C 6C 65 74 70 6B 67 08 ......walletpkg.
A0 00 00 00 03 00 00 00 00 00 00 00 ............
(114664 usec)
<= 00 90 00 ...
Status: No Error
=> 80 E8 00 00 FF C4 82 02 A8 01 00 13 DE CA FF ED ................
01 02 04 00 01 09 77 61 6C 6C 65 74 70 6B 67 02 ......walletpkg.
00 1F 00 13 00 1F 00 0D 00 0B 00 66 00 12 01 87 ...........f....
00 0A 00 3A 00 00 00 DD 00 00 00 00 00 00 01 01 ...:............
00 04 00 0B 01 00 01 07 A0 00 00 00 62 01 01 03 ............b...
00 0D 01 09 77 61 6C 6C 65 74 61 70 70 00 01 06 ....walletapp...
00 12 00 80 03 02 00 01 04 04 00 00 00 3A FF FF .............:..
00 2D 00 42 07 01 87 00 04 30 8F 00 0A 18 1D 1E .-.B.....0......
8C 00 09 7A 05 40 18 8C 00 16 18 8F 00 10 3D 06 ...z.@........=.
10 08 8C 00 15 87 00 AD 00 19 1E 1F 8B 00 03 18 ................
8B 00 12 7A 01 10 AD 00 8B 00 08 61 04 03 78 04 ...z.......a..x.
78 01 10 AD 00 8B 00 06 7A 02 21 19 8B 00 02 2D x.......z.!....-
18 8B 00 0F 60 03 7A 1A 03 25 10 B0 6A 08 11 6E ....`.z..%..j..n
00 8D 00 0D 1A 04 25 75 00 2D 00 04 00 20 00 27 ......%u.-... .'
00 30 00 21 00 40 00 1B 00 50 00 15 18 19 8C 00 [email protected]......
0E 7A 18 19 8C 00 04 7A 18 19 8C 00 17 7A 18 19 .z.....z.....z..
8C 00 0B 7A 00 ...z.
(551929 usec)
<= 90 00 ..
Status: No Error
=> 80 E8 00 01 FF 11 6D 00 8D 00 0D 7A 03 24 AD 00 ......m....z.$..
8B 00 13 61 08 11 63 01 8D 00 0D 19 8B 00 02 2D ...a..c........-
1A 07 25 32 19 8B 00 07 5B 29 04 1F 04 6B 07 16 ..%2....[)...k..
04 04 6A 08 11 67 00 8D 00 0D 1A 08 25 29 05 16 ..j..g......%)..
05 10 64 6E 06 16 05 63 08 11 6A 83 8D 00 0D AF ..dn...c..j.....
01 16 05 41 11 27 10 6F 08 11 6A 84 8D 00 0D 18 ...A.'.o..j.....
AF 01 16 05 41 89 01 7A 03 24 AD 00 8B 00 13 61 ....A..z.$.....a
08 11 63 01 8D 00 0D 19 8B 00 02 2D 1A 07 25 32 ..c........-..%2
19 8B 00 07 5B 29 04 1F 04 6B 07 16 04 04 6A 08 ....[)...k....j.
11 67 00 8D 00 0D 1A 08 25 29 05 16 05 10 64 6E .g......%)....dn
06 16 05 63 08 11 6A 83 8D 00 0D AF 01 16 05 43 ...c..j........C
63 08 11 6A 85 8D 00 0D 18 AF 01 16 05 43 89 01 c..j.........C..
7A 03 22 19 8B 00 02 2D 19 8B 00 11 32 19 05 8B z."....-....2...
00 0C 1A 03 AF 01 8D 00 18 3B 19 03 05 8B 00 05 .........;......
7A 04 22 19 8B 00 02 2D 19 8B 00 07 5B 32 AD 00 z."....-....[2..
1A 08 1F 8B 00 14 61 08 11 63 00 8D 00 0D 7A 08 ......a..c....z.
00 0A 00 00 00 .....
(405152 usec)
<= 90 00 ..
Status: No Error
=> 80 E8 80 02 AE 00 00 00 00 00 00 00 00 05 00 66 ...............f
00 19 02 00 00 00 02 00 00 01 03 80 0A 01 03 80 ................
09 08 06 00 00 F0 03 80 0A 04 03 80 09 05 03 80 ................
0A 06 03 80 09 02 06 00 00 0D 01 00 00 00 06 00 ................
01 69 03 80 0A 09 06 80 07 01 06 00 01 49 03 80 .i...........I..
03 03 01 80 09 00 03 80 0A 07 03 80 03 01 03 80 ................
09 04 03 80 09 01 06 80 09 00 06 80 03 00 06 00 ................
00 94 06 80 10 06 09 00 3A 00 0E 1F 02 0F 0D 5A ........:......Z
41 11 05 05 41 0E 05 16 1A 00 28 04 06 07 04 07 A...A.....(.....
0A 04 08 0D 07 05 10 1D 06 06 06 07 08 08 04 09 ................
12 15 10 10 08 04 09 12 15 0D 0F 05 06 07 07 07 ................
05 0A 08 00 ....
(658167 usec)
<= 00 90 00 ...
Status: No Error
Load report:
684 bytes loaded in 1.8 seconds
effective code size on card:
+ package AID 9
+ applet AIDs 16
+ classes 21
+ methods 394
+ statics 0
+ exports 0
overall 440 bytes
cm> install -i 77616c6c6574617070 -q C9#() 77616c6c6574706b67 77616c6c6574617070
=> 80 E6 0C 00 24 09 77 61 6C 6C 65 74 70 6B 67 09 ....$.walletpkg.
77 61 6C 6C 65 74 61 70 70 09 77 61 6C 6C 65 74 walletapp.wallet
61 70 70 01 00 02 C9 00 00 00 app.......
(269663 usec)
<= 6A 80 j.
Status: Wrong data
jcshell: Error code: 6a80 (Wrong data)
jcshell: Wrong response APDU: 6A80
Unexpected error; aborting execution
Another question
2) According to the code I have to specify PIN number when I
install it. Is PIN different from PIN in the card?
Is it application dependent?
private WalletApp (byte[] bArray, short bOffset, byte bLength){
pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
// bArray contains the PIN initialization value
pin.update(bArray, bOffset, bLength);
// register the applet instance with the JCRE
register();
} // end of the constructor
Anyone can help?
I really appreciate your help2) According to the code I have to specify PIN number when I
install it. Is PIN different from PIN in the the card?
Is it application dependent?Yes, it is an card idependent but application dependent PIN.
Jan -
How to run an applet(in a html file) in the server?
I am using the jpedal Viewer inmy code, I embedded the applet code
in a html file , it is running fine, but when I try to run the same Viewer applet in the Server it is throwing an error
"java.lang.NoClassDefFoundError: org/jpedal/objects/acroforms/DefaultAcroRenderer
at org.jpedal.PdfDecoder.startup(Unknown Source)
at org.jpedal.PdfDecoder.<init>(Unknown Source)
at pdfViewer.PdfApplet.init(PdfApplet.java:199)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)"
What is the problem ?
Please suggest solution for it?
Its urgentI am trying to run the Applet in Tomcat server,
Could you post the code where you invoke the Applet? It sounds like you're saying you're trying to run the Applet as part of your server-side code. The other interpretation is that you are simply accessing the Applet through the browser that happens to be on the machine being used as the server.
Like I say, post the code that shows how you're trying to use the Applet "on the server". -
How to run "ClickMe" applet?
public class Spot {
public int size;
public int x, y;
public Spot(int intSize) {
size = intSize;
x = -1;
y = -1;
===================================================================
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class ClickMe extends Applet implements MouseListener {
private Spot spot = null;
private static final int RADIUS = 7;
public void init() {
addMouseListener(this);
public void paint(Graphics g) {
//draw a black border and a white background
g.setColor(Color.white);
g.fillRect(0, 0, getSize().width - 1, getSize().height - 1);
g.setColor(Color.black);
g.drawRect(0, 0, getSize().width - 1, getSize().height - 1);
//draw the spot
g.setColor(Color.red);
if (spot != null) {
g.fillOval(spot.x - RADIUS, spot.y - RADIUS, RADIUS * 2, RADIUS * 2);
public void mousePressed(MouseEvent event) {
if (spot == null) {
spot = new Spot(RADIUS);
spot.x = event.getX();
spot.y = event.getY();
repaint();
public void mouseClicked(MouseEvent event) {}
public void mouseReleased(MouseEvent event) {}
public void mouseEntered(MouseEvent event) {}
public void mouseExited(MouseEvent event) {}
==============================================
how to run it ?
Thank you advance~1.I have compiled it like this D:/>javac ClickMe.java
2.I also have wirtten "HTML":<applet code=ClickMe.class width=100 height=50>
</applet>
3.My problem is the compiling,there have many errors.The compiler say :It is CLASSPATH error.
I want to know when I run a applet how to set CLASSPATH in different conditons, such as the applet have
package or not have package .
Especially, I want to know how the "ClickMe" run.
thank you all the same . -
How to run an applet with .java files in 2 dirrerent directories ?
I have an applet with :
5 .java class files and its .html file in one directory and
2 .java class files ( with identical names) and its .html file in another directory .
How do I go about executing this applet ? In the past all the applets
I have run had all the classes in one directory.
Thank you in advanceIf you want them both in the same page, put both applet tags in 1 page,
I could do that but both directories have a SpaceDunes.class
and both directories have a Shot class (diffferent immplementations
but the same name)
so the applet tag
<APPLET CODE="SpaceDunes.class"
CODE="SpaceDunes.class"
This can't be the right approach ? ?
Thank you for your advice
<HTML>
<HEAD>
<TITLE>SpaceDunes Applet
</TITLE>
</HEAD>
<BODY>
<H1>SpaceDunes Applet
</H1>
<HR>
<APPLET CODE="SpaceDunes.class"
CODE="SpaceDunes.class"
WIDTH=500
HEIGHT=500
CODEBASE=".">
ALT="Your browser understands the <APPLET>
tag but isn't running the applet, for some reason."
Your browser is ignoring the <APPLET> tag!
</APPLET>
<HR>
</BODY>
</HTML> -
Sorry if i sound foolish how to run an applet through a java application
I am into java from last one month ank keep on exploring it in the want to
recently i created a application cum applet in the same class like
applet is doing its own task and there is a main method in the code
that does entirly different task lets assume displaying *'s on the dos prompt the program is getting complied and belive it its running as desired
but the only problem that i m facing if i use appletviewer Myclass.java
only the appletprog is displayed
and if i run java Myclass than only dos task is done
may be it is sounding foolish for most of you but if i can get a way
which will help me in excecuting only one of it and both of them run succesfully
it tryied different ways to do it but was not succesful
please do not get irreated if its bizzered but if you really have a solution for it .i will appreciate it
thanking youYes you can run an Applet from an application. The magic bit is providing an AppletContext and AppletStub!
Here's how you start it:
wpa = new WayPointsApplet(this);
new AppletWrapper(wpa, 380, 320);Here's the class definition: (includes code for my application that can be ignored.
// Define a wrapper class for the applet
class AppletWrapper extends Frame implements AppletStub, AppletContext {
Applet applet;
// Constructor
AppletWrapper(Applet a, int x, int y) {
applet = a;
setTitle(a.getClass().getName());
setSize(x, y);
Dimension ss = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((ss.width-x)/2, (ss.height-y)/2);
add(a, "Center");
a.setStub(this);
// Trap window closing
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
// Test if Write left undone before exiting???
if(WayPoints.wpa != null) {
if(!WayPoints.wpa.okToExit())
return; // Ignore
applet.stop();
applet.destroy();
if(WayPoints.debug || WayPointDefs.plot_debug) {
SaveStdOutput.stop();
System.exit(0); // EXIT Program
}); // end WindowListener
a.init();
show();
a.start();
} // end constructor
// AppletStub methods
public boolean isActive() { return true; }
public URL getDocumentBase() { return null; }
public URL getCodeBase() {
return WayPoints.currDir;
public String getParameter(String name) {
if (name.equalsIgnoreCase("DEBUG")) {
if (WayPoints.debug)
return "YES";
else
return "NO";
if(name.equals("PLOTDEBUG"))
return (WayPointDefs.plot_debug ? "YES" : "NO");
if (name.equalsIgnoreCase("SERVER"))
return "NO";
return "";
public AppletContext getAppletContext() { return this; }
public void appletResize(int width, int height) {}
// AppletContext methods
public AudioClip getAudioClip(URL url) { return null; }
public Image getImage(URL url) { return null; }
public Applet getApplet(String name) { return null; }
public Enumeration getApplets() { return null; }
public void showDocument(URL url) {}
public void showDocument(URL url, String target) {}
public void showStatus(String status) {}
} // end class AppletWrapper -
hi,
im trying to run an applet from JSP i am not able to see the output of the applet on the JSP page?
<APPLET CODE="com.metro.supex.admin.SampleApplet.class" HEIGHT="25" WIDTH="125" ALIGN="bottom"></APPLET>
this line of code is included in JSP to run the applet, it is giving error
java.lang.ClassNotFoundException:com.metro.supex.admin SampleApplet
please can you help me in this matter.And don't use the applet tag, use object embed.
use the htmlconverter in the jdk bin dir to convert an applet tag. -
How to run swing applets in a browser??
I understand it is a typical question and there lot of articles on it. I tried but am confused. I installed JRE1.3 which has java plug-in along with it which supports swing applets in a browser.Once i got that plug in i also downloaded html converter but am confused how should i run my swing applet.Can anyone please explain in simple steps as to how to achieve this objective..Thanks much in advance..an example would be of real big help
ThanksThe below links will help you.
http://java.sun.com/products/plugin//1.3/docs/index.docs.html
http://java.sun.com/products/plugin/1.3/plugin.faq.html -
Urgent: How to run Multiple Applets from a URL
Hi,
I am developing an applet that needs memory more than 64MB and I have used -Xmx to set it to 128 MB.
On my web page, I have 3 applications that use the same JAR file of the applet, but the problem is all applets are opened/loaded in same heap space by JVM. So, when I load first applet, it uses 80 MB and when I start 2nd applet, after using 40 MB, it throws OutOfMemory exception.
Is there a way to start each applet with fresh 128 MB heap space rather than all applets sharing 128 MB heap space?
Thanks,
AjitThat's some hefty requirements for an applet. I believe that the only way to do the Xmx thing on the client side is to have them manually add it in the JVM arguments section of the Java Plugin Control Panel.
The browser/plugin is going to use the same JVM to run all 3 applets in a page. I've never seen a way to tell it to do otherwise. The only separation is the applet contexts, but that is more of a security manager grouping thing.
Maybe you should look into how you can better manage your data so you don't need so much memory. -
How to run swing applets???
I already posed this question yesterday but i got no replies.please help me out.
I understand it is a typical question and there lot of articles on it. I tried but am confused. I installed JRE1.3 which has java plug-in along with it which supports swing applets in a browser.Once i got that plug in i also downloaded html converter but am confused how should i run my swing applet.Can anyone please explain in simple steps as to how to achieve this objective..Thanks much in advance..an example would be of real big help
Thanksu need to convert ur html-page with the applet-tags with the htmlconverter.
-
How to run a applet with dependencies???
Hi all,
I want to use jasper report with applet. How to add jasper*.jar and commons*.jar in classpath to run applet at client side?
if anybody done this before or have any idea kindly write.
Thanks in advance!!
-BalajiBalaji wrote:
..I want to use jasper report with applet. How to add jasper*.jar and commons*.jar in classpath to run applet at client side?Add references to the Jars in the archive attribute of the applet (http://download.oracle.com/javase/tutorial/deployment/applet/html.html).
AKA RTFM. -
HOW TO RUN THE APPLET IN JAR?
Hi,
I have an simple applet . I have created the jar file for the applet using the jar utility.
1. I would Like to make my applet run simply by double clicking of the jar file.
2. I have included in the manifest file manifest.inf the main-class file.
3. When I double click I get the message failed to load the main-class
Can anyone help
G.ThirukumaranAs an Applet does not have a method main, then obviously you need to convert it to an application, which does.
-
How to run an applet with JDBC connectivity on a web browser
I've created an Applet in Java with SQL connectivity...i.e. it retrieves certain data from a table in SQL and puts in the TextField.....
Now, the problem is that this Applet works in NETBEANS....but fails to work when I use a web-browser..or the "appletviewer" command....
It says that it doesn't have permission to access local files....On Research, i've found that it is somethin' related to the concept of "Signed Applets", "Permissions" & "Security Policies" in java which doesn't allow any applet (without Certificate) to access Local Files.....
Can Somebody please tell how to overcome this problem.....?I'm going to be blunt with you. You are most likely going to have to redesign your application from scratch. And if it turns out you don't have to then you should anyway because it's a bad idea and fraught with peril.
Anyway here the major touchpoints on this discussion. You can be the judge of how these various points apply to you.
- Applets are restricted. - Yes Applets have a number of security restrictions on what they can or cannot do. This is designed to protect users from malicious applets. By signing your applet you can request permission from the user to do certain activities that are otherwise restricted. But not all.
- If you are using the JDBC-ODBC bridge then you need a different driver. If you sign your applet it might work in some limited scenarios but it will be hairy and is discouraged.
- If you are using Access or another file based database (CSV Excel etc) then you are doomed. You'll have to get yourself a different database. A non file based one. It doesn't matter if you sign your applet or not. You're still doomed.
- If you are trying to connect to a database server that is not at the same physical address as your web server you are doomed. Signing the applet will not help
- Connecting directly to a database from an applet is extremely risky business. Starting with now anyone can steal your username and password for your database quite easily.
What you should do in the redesign is put all the database accessing code in a Servlet. This Servlet does not have to be Java, it could be PHP, Perl, ASP, etc. It doesn't matter. Just put it on the server side. Then have your applet connect to this code via a webservice to do what is required.
Maybe you are looking for
-
Problems with installation on Windows XP Pro with SP1
Hi! I've two problems during installation. I try to install Oracle 10g Enterprise First: Checking Network Configuration requirements ... Check complete. The overall result of this check is: Not executed <<<< Recommendation: Oracle supports installati
-
Frame drop independend script?
I tried to run a script with setInterval within an exact time interval but if the interval is smaller than the frame time (even if fps are set highter) when framedrops occur the script does not seem to be executed early enough. Is there a more decent
-
I am writing a report to get a summary on on-hand inventory for a 30 period. I am going to attach my query. I am looking for suggestions on optimizing this so the report won't take forever to run. USE [ReportData] GO /****** Object: StoredProcedure [
-
6th Generation Airport Extreme Freezing During Time Machine Backups using LaCie 1TB Hard Drive
I recently upgraded from a 4th generation Airport Extreme (short, dual band n) to a new 6th generation Airport Extreme (tall, dual-band ac) in the hopes of having quicker backups and better WiFi performance (I also just got a 13" retina MacBook Pro).
-
Outbound function module for IDOC WMMBID02
Hi, Do we have any outbound function module for basic IDOC type WMMBID02 (Stock movements from ext. systems) which has message type WMMBXY. I searched with hot keys OUTBOUND_WMMBXY in SE37 but unable to find a standard FM. My task is to extend that F