Tuesday, 18 August 2015

Installing MAF 2.1.2 and MCS Lab Utility on Mac (OS X Yosemite 10.10.4)

During the OFM Summer Camp for Mobile Cloud Service (MCS) it was all going very smooth. In fact too good!! until I had to set up MAF 2.1.2 in JDevleoper and configure the utility provided in the lab (maf-mcs-utility-2.1.3.1.4). At this point nothing worked…The fact that I use Mac didn’t make things easier either as most people were on Windows and the lab sort of assumed the same….. So after at least 6 hours banging my head against the wall I finally found a solution.

Word of Caution
I initially tried to make this work in an existing Jdeveloper 12.1.3 soaquickstart installation. I tried to set up MAF 2.1.2 in this environment (following the docs steps) and it got to the point that I was getting all sort of weird errors (many related to MDS not loading and others around compilation). So at this point I decided to do a full clean install of everything (including Java).
Below the steps:

Preparation:
  1. Uninstall JDK 1.8 or JRE 1.8 (if you don’t have a JDK installed yet) by following these instructions
    1. JDK uninstalling steps: https://docs.oracle.com/javase/8/docs/technotes/guides/install/macjdk.html#A1096903
    2. JRE uninstalling steps: https://www.java.com/en/download/help/macuninstalljava.xml
  2. Download JDK 1.7 from: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
  3. Download JDK 1.8 (for later use) from: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  4. Download JDeveloper 12.1.3 from: http://www.oracle.com/technetwork/developer-tools/jdev/downloads/index.html
  5. Install Xcode from https://developer.apple.com/xcode/
    1. If Xcode is already installed make sure SDK is installed by clicking on Xcode Menu > Preferences > Download
    2. If no simulator is installed, click on the latest simulator to install it
Installation:
  1. Double click on jdk-7uxx-macosx-x64.dmg to install JDK 1.7
    1. Open a command prompt and check that it was properly installed by running java -version
  2. Open a command prompt and change directory to the folder where jdevsuite121300.jar was downloaded to.
    1. Then execute: java -jar jdevsuite121300.jar
    2. Follow steps as indicated. Make sure to take note of the Oracle inventory and Oracle home paths as you might need them later
    3. Also if you’re planning to run different installations of Jdeveloper, use a distinctive Oracle home (i.e. fmw1213-maf212)
  3. Open Jdeveloper and click on the menu Help > Check for Updates
  4. Tick on “Official Oracle Extensions and Updates” and click Next
  5. Tick on “Mobile Application Framework” then click Next
  6. Click on “I Agree” then click Next and finish
  7. Don’t restart JDevleper when prompt. Instead close it
  8. Now install JDK 1.8 by double clicking on jdk-8u51-macosx-x64.dmg
  9. Open Jdeveloper
  10. When prompted to enter JDK 1.8 enter the path which usually is "/Library/Java/JavaVirtualMachines/jdk1.8.051.jdk/Contents/Home" and click Ok
  11. Right click on ViewController from the projects window then select “Project Properties” then click on Libraries and Classpath. Make sure that the Java SE version is "MAF JDK 1.8 Compact 2 Profile”. If this is not the case chances are you will hit issues. You may try the following solution but there is no guarantee it will work https://community.oracle.com/thread/3669368
  12. Go to http://docs.oracle.com/cd/E6577401/tutorials/tutmcsbasic/tutmcsbasic2.html and click on “Downloads” to get file labfiles.zip.
  13. Unzip labfile.zip
  14. Open Jdeveloper (if not already opened)
  15. Using Jdeveloper open file <path where unzipped>/maf-mcs-utility-2.1.3.1.4/PublicSample/mafmcsUtilitySample.jws
  16. Click on the menu Jdeveloper > Preferences and then Mobile Application Framework > iOS Platform
    1. Click on the Browse icon and search for the folder "Automatically Add to iTunes” note that in my case it appeared as "/Users/luisweir/Music/iTunes/iTunes Media/Automatically Add to iTunes.localized” for some reason
  17. Click on menu Run Click on menu Build > Clean all
  18. Right click on ViewController and then click Run > iOS Simulator
  19. Hopefully the Simulator Window will open!! if it doesn’t, well, good luck finding a solution (and if you do, kindly add it to this blog for others to learn from it)
Lastly for instructions on how to set up the MAF Samsung emulator on Mac follow these instructions: http://docs.oracle.com/middleware/maf212/mobile/install/mafig_setup.htm#MAFIG164

No comments:

Post a Comment