All I'm very new to java and sshj so if I state something obvious or incorrectly please don't shoot me, I just figured I'd pass along this information as it took me a couple hours fighting to figure it out myself. Perhaps it's obvious to others but I was hoping someone could update the sshj page with these comments to help new users.
The latest 0.10.1 release from github now appears to require the JCE jars be installed or the maven build will fail. If you don't have it you will get errors about key size too large. I think it has something to do with encryption restrictions outside the US, perhaps other users don't get this if they are downloading from somewhere else. At any rate the fix for me was to download the jce jar files below and then put them in the JDK/jre/lib/security folder. I don't know if they must be installed in the "jre" on the customer side but it's definitely required in the JDK to compile. I'd like to suggest someone include this in the Dependency section as the error the maven compile gives is misleading and I only figured it out by digging into the "PuTTYKeyFileTest.java" file where I found a comment that said: // Install JCE Unlimited Strength Jurisdiction Policy Files if we get java.security.InvalidKeyException: Illegal key size
The latest .0.10.1 release from github now appears to REQUIRE bcprov-ext-jdk15on-151.jar if you don't have it included then the default SSHExec.java example won't run because:
Exception in thread "reader" java.lang.NoClassDefFoundError: org/bouncycastle/asn1/nist/NISTNamedCurves
I don't know if this was intended or not, but I think it would be good to change your recommended bounceycastle to a "required" if it is which it seems like it is now.
If someone knows a way to NOT require the bounceycastle I would like to drop it.. it adds a lot of bulk to any JAR files you build and for most applications I dont' think you will need it.
Just a shotout to shikhar to say thanks for the great work! :)
All I'm very new to java and sshj so if I state something obvious or incorrectly please don't shoot me, I just figured I'd pass along this information as it took me a couple hours fighting to figure it out myself. Perhaps it's obvious to others but I was hoping someone could update the sshj page with these comments to help new users.
JCE Location Java 8 : http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
If someone knows a way to NOT require the bounceycastle I would like to drop it.. it adds a lot of bulk to any JAR files you build and for most applications I dont' think you will need it.
Just a shotout to shikhar to say thanks for the great work! :)