Signed JAR file won�t work on A Mac
Hello I am trying to run this java script on a Mac
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
import java.io.*;
public class Applet1 extends Applet {
private FlowLayout flowLayout1 = new FlowLayout();
private JFileChooser jFileChooser1 = new JFileChooser();
public Applet1() {
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
private void jbInit() throws Exception {
this.setLayout(flowLayout1);
this.add(jFileChooser1, null);
The signed jar works properly on pc and it doesn�t work on a Mac.
I am using JDK 2.5 and swing 1.1.1
What error are you getting?Swing: checked access to system event queue.
An exception occurred:
com.apple.mrj.JManager.JMAppletSecurityExc: security.checkread: /, /
at com.apple.mrj.JManager.JMAppletSecurityOld.checkRead(JMAppletSecurityOld.java)
at com.apple.mrj.JManager.JMAppletSecurityOld.checkRead(JMAppletSecurityOld.java)
at java.io.File.exists(File.java)
at javax.swing.filechooser.UnixFileSystemView.getRoots(FileSystemView.java:270)
at javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.<init>(MetalFileChooserUI.java:683)
at javax.swing.plaf.metal.MetalFileChooserUI.createDirectoryComboBoxModel(MetalFileChooserUI.java:666)
at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(MetalFileChooserUI.java:145)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:106)
at javax.swing.JComponent.setUI(JComponent.java:258)
at javax.swing.JFileChooser.updateUI(JFileChooser.java:1296)
at javax.swing.JFileChooser.setup(JFileChooser.java:294)
at javax.swing.JFileChooser.<init>(JFileChooser.java:270)
at javax.swing.JFileChooser.<init>(JFileChooser.java:233)
at Applet1.<init>(Applet1.java:13)
at com.apple.mrj.JManager.JMAppletViewer_OLD.doLoadCode(JMAppletViewerOld.java)
at com.apple.mrj.JManager.JMAppletViewer_OLD.setState(JMAppletViewerOld.java)
at com.apple.mrj.JManager.JMViewerEvent.post(JMAppletViewerOld.java)
at com.apple.mrj.JManager.AVDispatcherThread.run(JMAppletViewerOld.java)
Similar Messages
-
JSP referencinc taglib.tld in JAR file doesn't work.
I have some custom tags which work fine under Weblogic 5.1 when I do a
normal deployment of files, including the taglib.tld. However, when I
try to reference the taglib.tld located in a JAR file, then weblogic
throws an error saying that it cannot resolve into a valid tag library.
I am only doing this because I am testing the same site agains both
iPlanet Web Server and Weblogic. iPlanet will only find the taglib.tld
when it is in a JAR file.
Can anyone shed some light on referencing the taglib.tld in a JAR file.
This should work, as it is covered in the JSP 1.1 specification.
FYI - the jar file is in the same location as the JSP which references
it. The URI to the JAR file (in the JSP) is from the root of the site.
Thanks for any help.
-Scott Edwards
Welcome to the Sun forums.
Subject: My Applet Jar file doesn't work !! .
1) Note that one '!' denotes exclamation, whereas 2 or more often denotes a dweeb.
2) Since you are on your first post, I will point out that applets are an advanced topic, and should not be attempted by newbies.
3) "doesn't work" is very vague. It is likely to produce a reply like "maybe the applet is lazy - try flogging it".
Amera wrote:
..I have written this java applet :When posting code, code snippets, HTML/XML or input/output, please use the code tags. The code tags help retain the formatting and indentation of the sample. To use the code tags, select the sample and click the CODE button.
Also note that the most preferred form of code is an SSCCE *(<- link).* In an SSCCE, your would remove all but one button (if the actionPerformed fails with 6 or 7 buttons, trim it down to fail with just one or two.
i made a jar file :So does the applet work before you make the Jar file? Your post so far suggests the Jar file is the problem.
i created a file and named it MANIFEST.MF .i wrote inside it :
Main-Class: test
Then i placed it in a folder with the test.class .I created jar file using command line.
I entered the test.class path and then wrote this command :
jar cvfm myjar.jar MANIFEST.MF *.class
Then the jar file "myjar.jar" is created .
it's executed but this function "public void actionPerformed(ActionEvent e) " won't wrok.
i keep pressing the buttons but nothing is happening !!So you get 'no output in the console & no effect in the applet'?
What is the URL where I can see your applet failing?
As an aside, since Sun does not guarantee that applet clients will act on the showDocument command, even if it does not work, it would not be a 'bug'.
Edited by: AndrewThompson64 on Dec 28, 2009 11:18 AM -
Turning off jar cache causes classnotfound with signed jar files
Hi,
I have a problem with applet signed jars when the java cache is turned off.
With the cache turned off, I get a class not found for the first class it attempts to use from the signed jar file from an applet.
If I turn the jar caching on, all works perfectly with no other changes.
Anyone have any ideas? This is java 6u16.
Thanksjkc532 wrote:
.. Is the fact that the CachedJarFile class doesn't attempt to reload the resource when it can't retrieve it from MemoryCache a bug? From your comprehensive investigation and report, it seems so to me.
..I've dug as deep as I can on this and I'm at wits end, does anybody have any ideas?Just after read the summary I was tired, so I have some understanding of the effort you have already invested in this (the 'wits' you have already spent). I think you should raise a bug report and seek Oracle's response. -
Three questions about signed jar file and applet
I use three signed jar file. Each of them signed by different certificate. First of JARs contain applet class. When I start applet from html page I see message “This applet was signed by…… but Java cannot verify it… Do you trust…?”. All times I press “Yes I trust” and after this questions applet stop to work end exit. If I use only one certificate for signing of three JARs then applet continue to work after question. 1) What should I do to fix this bug? 2) Is it any method to check from applet that user press Trust button? Is it any method to emulate work of SecurityManager to check that Certificate object is trusted (I want do call some method check(Certificate) and if certificate is not trusted I want to see message with question: “Do you want to trust this certificate” and so on)?
Hello Jarman,
1. If I have a signed jar file, then as long as the
certificate is recognised as trusted that applet can
run as a fully trusted application on the client
machine. So I should not have to add lines such as
permission java.lang.RuntimePermission
"readFileDescriptor", "read" ;
permission java.lang.RuntimePermission
"writeFileDescriptor", "write" ;
to my java.policy file. true/false ?true
2. If I am running a signed jar file in the Java
plugin then I do not need to have a verisign or thawte
certificate (however to allow my certificate to be
accepted I do have to import it into the cacerts file
on the client machine). True/false?true
3. Following on from question 2, if I want to be able
to run an applet on a client machine, without messing
around with ANY files on those machines, I need a
verisign or thawte certificate. True/false?true
4. (And finally) Apart from a security exception
saying that I need to add one of the lines like those
of question 1, is there any way I can get other debug
information as to why the signed jar file is not being
recognised as signed?No. This could be a problem of importing your certifcate into the wrong place.
The information on the following link is a little bit dated but it helped me to successfully install a testcertificate and sign an applet with it.
http://www.suitable.com/Doc_CodeSigning.shtml -
My Applet Jar file doesn't work !!
hello ,
I have written this java applet :
import java.awt.*;
import javax.swing.*;
import java.applet.Applet;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;
public class test4 extends Applet implements ActionListener{
private static final long serialVersionUID = 1L;
private JButton B1 =new JButton("Forward ");
private JButton B2 =new JButton("Backward");
private JButton B3 =new JButton("Left");
private JButton B4 =new JButton("Right");
private JPanel P1 = new JPanel();
private JPanel P2 = new JPanel();
private JPanel P3 = new JPanel();
private JPanel P4 = new JPanel();
private JPanel P5 = new JPanel();
private JPanel P6 = new JPanel();
private JLabel L3 = new JLabel(" ");
private JLabel L4 = new JLabel(" ");
private JLabel L5 = new JLabel(" ");
private JLabel L6 = new JLabel(" ");
private JLabel L7 = new JLabel(" ");
JSplitPane sppSplitPane0 = new JSplitPane( );
public test4()
JFrame.setDefaultLookAndFeelDecorated(true);
sppSplitPane0.setDividerLocation( 250 );
P3.add(L4);
P3.add(B1);
P3.add(L5);
P5.add(B3);
P5.add(L3);
P5.add(B4);
P4.add(L6);
P4.add(B2);
P4.add(L7);
P1.setLayout(new BorderLayout());
P1.add("North",P3);
P1.add("Center",P5);
P1.add("South",P4);
P2.setLayout(new BorderLayout());
P2.add("North" , P1);
B1.addActionListener(this);
B2.addActionListener(this);
B3.addActionListener(this);
B4.addActionListener(this);
sppSplitPane0.setLeftComponent(P2);
sppSplitPane0.setRightComponent(P6);
public void actionPerformed(ActionEvent e) {
try {
if (e.getSource() == B4) {
URL myNewURL = new URL("http://amera/cgi-bin/test.cgi?R");
System.out.println("URL = " + myNewURL);
getAppletContext().showDocument(myNewURL,"blank");
else
if (e.getSource() == B3) {
URL myNewURL = new URL("http://amera/cgi-bin/test.cgi?L");
System.out.println("URL = " + myNewURL);
getAppletContext().showDocument(myNewURL,"blank");
else
if (e.getSource() == B2) {
URL myNewURL = new URL("http://amera/cgi-bin/test.cgi?B");
System.out.println("URL = " + myNewURL);
getAppletContext().showDocument(myNewURL,"blank");
else {
URL myNewURL = new URL("http://amera/cgi-bin/test.cgi?F");
System.out.println("URL = " + myNewURL);
getAppletContext().showDocument(myNewURL,"blank");
} catch (Exception err) {
System.err.println("Error!\n" + err);
showStatus("Error, look in Java Console for details!");
public static void main(String[] args) {
test t=new test();
JFrame frame =new JFrame();
frame.add(t.sppSplitPane0);
frame.setSize(1100,700);
frame.setVisible(true);
i made a jar file :
i created a file and named it MANIFEST.MF .i wrote inside it :
Main-Class: test
Then i placed it in a folder with the test.class .I created jar file using command line.
I entered the test.class path and then wrote this command :
jar cvfm myjar.jar MANIFEST.MF *.class
Then the jar file "myjar.jar" is created .
it's executed but this function "public void actionPerformed(ActionEvent e) " won't wrok.
i keep pressing the buttons but nothing is happening !!
please help me .
Edited by: Amera on Dec 27, 2009 2:51 PMWelcome to the Sun forums.
Subject: My Applet Jar file doesn't work !! .
1) Note that one '!' denotes exclamation, whereas 2 or more often denotes a dweeb.
2) Since you are on your first post, I will point out that applets are an advanced topic, and should not be attempted by newbies.
3) "doesn't work" is very vague. It is likely to produce a reply like "maybe the applet is lazy - try flogging it".
Amera wrote:
..I have written this java applet :When posting code, code snippets, HTML/XML or input/output, please use the code tags. The code tags help retain the formatting and indentation of the sample. To use the code tags, select the sample and click the CODE button.
Also note that the most preferred form of code is an SSCCE *(<- link).* In an SSCCE, your would remove all but one button (if the actionPerformed fails with 6 or 7 buttons, trim it down to fail with just one or two.
i made a jar file :So does the applet work before you make the Jar file? Your post so far suggests the Jar file is the problem.
i created a file and named it MANIFEST.MF .i wrote inside it :
Main-Class: test
Then i placed it in a folder with the test.class .I created jar file using command line.
I entered the test.class path and then wrote this command :
jar cvfm myjar.jar MANIFEST.MF *.class
Then the jar file "myjar.jar" is created .
it's executed but this function "public void actionPerformed(ActionEvent e) " won't wrok.
i keep pressing the buttons but nothing is happening !!So you get 'no output in the console & no effect in the applet'?
What is the URL where I can see your applet failing?
As an aside, since Sun does not guarantee that applet clients will act on the showDocument command, even if it does not work, it would not be a 'bug'.
Edited by: AndrewThompson64 on Dec 28, 2009 11:18 AM -
I am quite new to java so I hope my question is not stupid.
I used bluej to realize an application.It works when executing the main method in bluej,but when I create the jar file,it simpy doesn't work.I have included the main class when creating the jar file.When double-clicking on the jar file, it makes the typical error sound of windows,but it doesn't show any message.
What is the problem?Welcome to the Sun forums.
Subject: My Applet Jar file doesn't work !! .
1) Note that one '!' denotes exclamation, whereas 2 or more often denotes a dweeb.
2) Since you are on your first post, I will point out that applets are an advanced topic, and should not be attempted by newbies.
3) "doesn't work" is very vague. It is likely to produce a reply like "maybe the applet is lazy - try flogging it".
Amera wrote:
..I have written this java applet :When posting code, code snippets, HTML/XML or input/output, please use the code tags. The code tags help retain the formatting and indentation of the sample. To use the code tags, select the sample and click the CODE button.
Also note that the most preferred form of code is an SSCCE *(<- link).* In an SSCCE, your would remove all but one button (if the actionPerformed fails with 6 or 7 buttons, trim it down to fail with just one or two.
i made a jar file :So does the applet work before you make the Jar file? Your post so far suggests the Jar file is the problem.
i created a file and named it MANIFEST.MF .i wrote inside it :
Main-Class: test
Then i placed it in a folder with the test.class .I created jar file using command line.
I entered the test.class path and then wrote this command :
jar cvfm myjar.jar MANIFEST.MF *.class
Then the jar file "myjar.jar" is created .
it's executed but this function "public void actionPerformed(ActionEvent e) " won't wrok.
i keep pressing the buttons but nothing is happening !!So you get 'no output in the console & no effect in the applet'?
What is the URL where I can see your applet failing?
As an aside, since Sun does not guarantee that applet clients will act on the showDocument command, even if it does not work, it would not be a 'bug'.
Edited by: AndrewThompson64 on Dec 28, 2009 11:18 AM -
Hi,
I have an Applet packed in a JAR file. It works very well in my local site, but when I upload it to internet it throws a java.lang.ClassNotFoundException: nibbly
Of course I've checked names, cases, files are in the same directory.
The html code is very simple:
<APPLET ARCHIVE="nibbly.jar" CODE="nibbly.class"
WIDTH=402 HEIGHT=350>
</APPLET>
Any help or advice would be appreciated.
Thank youyou can see the error in
www.magnino.terra.cl/arch/nibbly.html
I will check the "binary mode" of my FTP
the nibbly.jar is in the same directory of the nibbly.html page
thank you
Luis -
Jar file is not working after deleting all packages from the same directory
hello
i have created a jar file named as server.jar in the same directory in which i have all the packages(for which i have created this jar file).This jar file was working correctly when i had all the packages in the same directory.But after deleting all the packages from the same working directory, this jar file is neither working nor giving any error message..
Please tell me what may be the reason???
thanks in advancedhello
i have created a jar file named as server.jar in the same directory in which i have all the packages(for which i have created this jar file).This jar file was working correctly when i had all the packages in the same directory.But after deleting all the packages from the same working directory, this jar file is neither working nor giving any error message..
Please tell me what may be the reason???
thanks in advanced -
URLClassLoader + dynamically loading signed jar files
I have an applet that does not know all of the jar files it will need to load at startup.
I would like to dynamically load these signed jar files using the URLClassLoader, however it does not recognize these jar files as being signed and I get java.security.AccessControlException: access denied errors.
Any suggestions?
Thanks!Try this classloader for loading the jars, it should to the trick:
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLStreamHandlerFactory;
import java.security.AllPermission;
import java.security.CodeSource;
import java.security.PermissionCollection;
import java.security.Permissions;
public class AllPermissionsClassLoader extends URLClassLoader {
public AllPermissionsClassLoader (URL[] urls) {
super(urls);
public AllPermissionsClassLoader (URL[] urls, ClassLoader parent) {
super(urls, parent);
System.out.println(parent);
public AllPermissionsClassLoader (URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) {
super(urls, parent, factory);
protected PermissionCollection getPermissions (CodeSource codesource) {
Permissions permissions = new Permissions();
permissions.add(new AllPermission());
return permissions;
} -
How can i add update signed jar file
I am developing an applet which requires signing to run in a browser.
I am developing supporting classes. But these class files have to be added
to the jar. Isnt it??
But to test the applet i need to load it in the browser each time i modify the class files. So the jar file need to be updated every time. But an
IOError
is being displayed when i try to update the signed jar file.
How can i update signed jar file?? Or is there any othe way to test the signed applet during development??How can i update signed jar file?You can't, the signature is there to make sure the content of the jare hasn't been messed
with.
Either recreate the jar and re sign it or set up a policy during testing. -
I have been importing cr2 raw files to my iPad using ios 5 but importing cr2 raw files won't work on ios 6. Sees files in camera but when import stops it fails with an exclamation mark in red circle. Anyone have a solution?
Don't know if you care anymore or it applies, but I was able to get things working but it took drastic measures.
I had to do a full system reset and update by doing the following:
- Make note of all your settings in your system and apps especially accounts and forget about in app data that's only on your iPad and not in a cloud service because it will be gone after this
- Connect iPad to Mac and startup iTunes
- Hold down Home and Power buttons simultaneously for about 8 sec until the screen turns black
- Release the Power button but continue holding the Home button until there's a popup on your screen which indicates it's in recovery mode
- Follow the instructions to recover your iPad but recover it to factory state, not recover from a backup
- Reinstall all your apps and content
- Reconnect to all your services on your system and apps
I could not restore from a backup since it brought back my bad data too. It also didn't restore my music and no matter what I tried it wouldn't put my music onto my iPad. Had to start clean.
It appears over time that the system gets dirty and there's lots of bad data that can't get resolved. This is especially true if some of your apps have crashed a bunch. -
Is it possible to verify a signed jar-file from a program?
Is it possible to verify a signed jar-file from a program
(using some API) likewise jarsigner does?Is it possible to verify a signed jar-file from a
program
(using some API) likewise jarsigner does?Hi,
You would have to open the jarfile, read each jar entry and for each of them do a getCertificates() and then in turn verify each certificate with the public key of the enclosed certificates in the jar file.
An easier solution would be to use the verify flag of the JarFile or JarInputStream.
Hope it helps..
Cheers,
Vijay -
If I already purchased FaceTime for Mac and recently upgraded my HD. How can I retrieve that app again? I found it in my Time Machine back up, but the files won't work. Please help.
Nope. I do the same exact thing. If you have DVD's and blu-rays you can't download a free application called Handbrake. You can set it to Apple TV2 automatic format and they will come out as playable m4v's that can play I'm iTunes. All you have to do is turn on Home Sharing in both iTunes and your Apple RV and you'll be good to go!
-
Standalone Projector won't work on a Mac when output from Mac Flash 8 Pro
Standalone Projector won't work on a Mac when output from Mac Flash 8 Pro
I'm outputting a Mac projector file that will work on my mac computer. However, when I upload it to FTP and download it my mac or another mac, it won't work! What's going on? I've tried adding ".app" to my file and it still won't work. Help!
Here's my set up: Flash 8 Pro on Mac Intel with Mac OS 10.4.11Hi,
Does it work if you .zip up the projector and FTP the .zip and then unzip the projector on the other Mac's? A projector is basically an application. Applications in Mac's have package contents and resource bundles. When copying files over the network on Mac's, symbolic links inside the package contents and bundles can get messed up.
Thanks,
Nivesh -
.avi animations made with Flash won't work on my mac laptop (version 10.6.8) but they used to. What is the problem?
let me be more specific, the .avi animations will not play in Quicktime on this laptop, but they used to. When I import them into final cut express they won't show up there either. What should I do to fix this?
Maybe you are looking for
-
How do I clone a database but still apply old archivelogs? Getting ORA-1223
Hi, I'm doing a clone from PROD to DEV in 9.2.0.6 for 11.5.10.2 on Solaris 9. I worked through many issues, such as copying the files, changing the init<SID>.ora to the new DEV values, re-editing all of the env files with the new SID on the new (targ
-
Extended Classic Scenario - SHC: Buffer table not up to date
Hello all, I'm working in SRM_SERVER 550, SAPKIBKT11, and having issues using BACKEND PURCHASING ORGANISATIONS and the Extended Classic Scenario. According to SAP note 944918 the following indicator should not be required to be set: Supplier Relation
-
How to handle Investement Management Account (IMA)?
Hi, Our client engages in Investment Management Account arrangement with a bank where in; Under an IMA arrangement, the Principal (our client) transfers and delivers to the Investment Manager (bank) a sum of money which the latter shall manage, inves
-
Split text into number and text
Hi , My problem is something like this....." 5 feet 6 inch ". This is a single string(varchar). since i cannot calculate value (6*5) here .i need to make it taking from database separate. And later calculate value.Is there any possibility throught wh
-
Hi, How many types of signatures need to be enable while IDSM-2 deploying in Data Center behind FWSM? Thanks