I'm on OS X and have been using Java 1.8 from Oracle. In order to install mfp
I did have to install the old Java 6 from Apple, but it also seems certain mfp
commands, mfp build
at least, fail unless I change my JAVA_HOME
environment variable to point to the Java 6 installation.
Here's the output I see:
$ mfp build
[Error:
BUILD FAILED
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:133: The following error occurred while executing this line:
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:155: Class not found: javac1.8
Total time: 1 second]
Error: Sorry an error has occurred. Please check the stack above for details.
$ JAVA_HOME=/Library/Java/Home mfp build
All apps and adapters were successfully built.
$
What's the best way for me to override JAVA_HOME
for mfp
?
Should I edit /Applications/IBM/MobileFirst-CLI/mfp
?
(FYI, the "javac1.8 class not found" error is a known problem with Ant < 1.9, which I assume is bundled with the MobileFirst-CLI as I have Ant 1.9.4 on my system with my Java 1.8 installation.)
The best approach here is to have a simple wrapper script as mentioned previously. This keeps you safe from updates. Also, be sure to remove the PATH setting in "/etc/profile". Its quite simple...
In Bash:
In node...
Hope this helps.