Comments (3)
I had the chance to try this in a fresh macOS 10.12 (Sierra) VM and this is what I've learned.
These days, Java does not come with macOS. So when you go to install Java, you are usually pointed to Oracle Java.
Oracle Java is installed in two locations depending on if you choose to install the JRE or JDK.
- JRE:
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/
- JDK:
/Library/Java/JavaVirtualMachines/jdk1.x.x_xxx.jdk/Contents/Home/
The JRE allows you to double-click to open jars from the Finder and run Java in the browser, but the JRE does not come with the java
binary. If you want to run any of the typical Java commands (e.g., for Briefcase's CLI mode), you must install the JDK.
You don't need to install both the JDK and JRE because if you install the JDK, it will also install the JRE at the JRE location list above.
You might have multiple JDKs. Check their locations with /usr/libexec/java_home -V
Briefcase will run fine with the JRE or the JDK, but to unencrypt forms, users must install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
- Java 7: http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
- Java 8: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html.
JCE is a zip file with two files local_policy.jar
and US_export_policy.jar
. These files must be placed in these locations:
- JRE:
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/
- JDK:
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/security/
The "limited" versions of these files already exist in those locations, so it's easiest to rename them to *.bak and then install the "unlimited" versions. You must then reboot because the JRE only seems to load new jars on reboot.
If you have the JDK, you must install the policy files in both locations. This is because the JRE is used when you double-click the jar, but the JDK is used when you run Briefcase from the command line.
So, with that background, the reason why brew cask install java jce-unlimited-strength-policy
does not work is because jce-unlimited-strength-policy only installs the Unlimited Strength Jurisdiction Policy Files in the JDK location, and not the JRE location.
I've updated the docs at https://opendatakit.org/help/encrypted-forms and I have filed an issue upstream on brew to fix this at Homebrew/homebrew-cask#32720.
from briefcase.
@yanokwa In OS X Sierra (10. 12)version 10.12 and java version "1.8.0_73" the encrypted export fails with the following stack.
java.security.InvalidKeyException: Illegal key size
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
at javax.crypto.Cipher.implInit(Cipher.java:805)
at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
at javax.crypto.Cipher.init(Cipher.java:1396)
at javax.crypto.Cipher.init(Cipher.java:1327)
at org.opendatakit.briefcase.util.CipherFactory.getCipher(CipherFactory.java:79)
at org.opendatakit.briefcase.util.EncryptionInformation.getCipher(EncryptionInformation.java:67)
at org.opendatakit.briefcase.util.FileSystemUtils.decryptFile(FileSystemUtils.java:476)
at org.opendatakit.briefcase.util.FileSystemUtils.decryptSubmissionFiles(FileSystemUtils.java:627)
at org.opendatakit.briefcase.util.FileSystemUtils.decryptAndValidateSubmission(FileSystemUtils.java:825)
at org.opendatakit.briefcase.util.ExportToCsv.processInstance(ExportToCsv.java:850)
at org.opendatakit.briefcase.util.ExportToCsv.doAction(ExportToCsv.java:145)
at org.opendatakit.briefcase.util.ExportAction$TransformFormRunnable.run(ExportAction.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
from briefcase.
@yanokwa However, downloading JCE libraries and placing them in ${java.home}/jre/lib/security/
worked !! :)
from briefcase.
Related Issues (20)
- Crash on export when submission is empty HOT 1
- Crash on reloading from Central server not right after configuring it HOT 1
- Crash on attempted cancel of pull from Central server when offline
- Socket closed when pushing 3k+ submissions to Central HOT 3
- Forms with external secondary instances aren't shown on export or push tabs HOT 1
- Crash when pulling forms with spaces in formId from Central
- Pull before export doesn't work for forms from Central
- Pull from Collect directory where a few versions of the same form are available is not possible HOT 1
- On pull from Central, submission attachments are not requested if submission folder exists
- Forms arenβt immediately showing up in push or export after a canceled pull - only with Java 8
- Export is crashing after canceling pull when empty submissions are created - Java 8
- Make documentation link in Central push warning dialog clickable
- Support empty form versions when doing multi-version push to Central
- Form selection is lost and status is missing on Export tab when pull before export process in progress
- Briefcase tabs are disabled when run on java 9 and 10 and select sd on Windows
- Pull/Push/Export tabs are still active when the storage location is cleared HOT 3
- On export, skip encrypted submissions with manifest but no .enc file and mark as failed
- Form selection and individual export configuration in export tab becomes disabled
- Export using CLI ok, but freezes / hangs using GUI (Key too long?)
- Export of encrypted submissions using Briefcase UI fails HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from briefcase.