Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Blackberry Signing Busted

Discussion in 'BlackBerry' started by Thickney, Jun 24, 2014.

  1. Thickney

    Thickney

    Joined:
    Mar 3, 2013
    Posts:
    32
    Hey all. I've been trying to get my Unity project set up for testing on a Blackberry device. After following the instructions in this guide: http://docs.unity3d.com/Manual/bb10-setup.html I end up with the following error when trying to register with RIM:


    Info: CSK file created.
    Exception in thread "main" java.lang.NoClassDefFoundError: sun/security/x509/CertAndKeyGen
    at net.rim.device.codesigning.keytool.KeyTool.a(Unknown Source)
    at net.rim.device.codesigning.keytool.KeyTool.if(Unknown Source)
    at net.rim.device.codesigning.keytool.KeyTool.a(Unknown Source)
    at net.rim.device.codesigning.keytool.KeyTool.main(Unknown Source)
    at net.rim.device.codesigning.barsigner.BarSigner.try(Unknown Source)
    at net.rim.device.codesigning.barsigner.BarSigner.a(Unknown Source)
    at net.rim.device.codesigning.barsigner.BarSigner.main(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 7 more

    UnityEditor.HostView:OnGUI()


    I'm running Unity 4.5.1 and I have had this error occur with both JRE 1.8 and JRE 1.6. I'm using a Macintosh with Mavericks. The CSJ file paths and pin are correct so I'm not sure what's going on here. Any suggestions?
     
  2. AlexThibodeau

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
  3. Thickney

    Thickney

    Joined:
    Mar 3, 2013
    Posts:
    32
    I've tried running this on my Windows 8.1 machine as well, which definitely has JDK 1.6 installed and I'm still getting the same problem. Only now instead of a class not found error, it's a method not found error for CertAndKeyGen.getSelfCerticate.

    Edit:
    After trying a bunch of other Java downloads I got it to work with Java 6 Update 45 and it has to be the 32-bit version. It would be really nice if this could get updated to work with a version of Java that isn't over half a decade old though.
     
    Last edited: Jun 24, 2014
  4. AlexThibodeau

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
    It's interesting that you were getting the class or method not found errors. We do currently require a 32bit version of java to be installed but I've put checks into Unity to ensure that this is the case. Is it possible that you had a 32bit version of 1.8 or 1.7 installed and when you were bouncing between java versions it was picking up the same 32bit version?
     
  5. Thickney

    Thickney

    Joined:
    Mar 3, 2013
    Posts:
    32
    Yeah, it seems like that's what was going on for the class not found error. The very first Java 6 release (1.6.0.0) had the missing method errors.
     
  6. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I'm getting same error, this workaround is not correct way, Unity should support latest version of Java and have this fixed.

    Plus Windows and Java is so much easier, try Mac
     
  7. Elkis

    Elkis

    Joined:
    Jun 15, 2013
    Posts:
    87
    Just wanted to say thank you for pointing out the exact version needed for this to work :)
     
  8. weareone

    weareone

    Joined:
    Apr 25, 2015
    Posts:
    1
    I have this same error when trying to create a dev certificate. Can I ask how you eliminated newer versions of java from being used? Did you have to uninstall them? Edit your environment vars?

    Thanks,
     
  9. AlexThibodeau

    AlexThibodeau

    Unity Technologies

    Joined:
    Jul 23, 2013
    Posts:
    309
    Hey there. Could you tell me what version of Unity you are using as well as the version of java that you have installed?
     
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    same error on 4.6.6 p2 mac - solution? browsed the unity doc, nothing indicates what else to install.
     
  11. Elkis

    Elkis

    Joined:
    Jun 15, 2013
    Posts:
    87
    If you are on Windows, you don't have to uninstall anything, change the path of the Java SDK on your environment variables to the specific version Thickney mentioned. After building the certificate, you can restore the path to whatever other version you were using before.