Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Monday, December 1, 2014

Hybrid Mobile - Apache Cordova Training Series with Eclipse via JBoss Developer Studio

We have been developing Eclipse tools for HTML5 Hybrid Mobile applications, leveraging Apache Cordova, jQuery and AngularJS/Ionic for a few years now.   This set of videos is primarily for "training purposes".  The ultimate goal is to get you started and making you productive with our mobile-focused Eclipse tools.

The series has been published to YouTube. JBoss Mobile (Cordova, jQuery, AngularJS, Ionic, Push) - YouTube

 1 - Installation: Walks through the installation of the Hybrid Mobile Tools into JBDS 8 - allowing you to create Apache Cordova based applications leveraging HTML5, jQuery Mobile or AngularJS+Ionic. In this video, you are introduce to CordovaSim and LiveReload features for interactively building your mobile UI. Integration with the iOS Simulator is also demonstrated (note: iOS Simulator requires Mac OSX)
2 - REST: Addition of a localhost EAP server, configuration to allow for remote connections (mobile clients are remote), deployment of a REST endpoint. Creation of a mobile application that interacts with the EAP hosted REST endpoint.
3 - Native API: Demonstrates how to use Apache Cordova Plug-ins to leverage native device functionality, in this case, access to the Contacts on the device itself. Also demonstrates deployment to a USB-connected Android phone.
4 - AngularJS + Ionic: Demonstrates how to start an AngularJS + Ionic project and import into JBDS. Use of the new Ionic Palette in JBDS.
5 - Push: Introduces how to configure Push Notifications - primarily focused on the EAP setup required to install our UnifiedPush Server to a localhost EAP. Includes the configuration of Android Google Cloud Messaging push notifications - demonstrated on actual Android device.
6 - More Native: Brings in some additional Apache Cordova Plug-ins to demonstrate use of the accelerometer and battery status APIs. CordovaSim providing interactive testing support, deployment to real Android device.
7 - iOS: Taking the same application created for Contacts and deploying it to an iPhone. Demonstrates the steps involved with using http://developer.apple.com, JBDS' Export Native Project and XCode with actual deployment to a local iPhone.

Wednesday, December 18, 2013

Eclipse does not contain the JNI_CreateJavaVM - Mac OS X (10.9) Mavericks

Based on a recent experience, I thought it would be useful to post this blog for others who might also be struggling with this particular error message. After the Mac OS X Mavericks (10.9) upgrade, I hit the following error message from Eclipse Kepler (4.3.1) 32-bit
The JVM shared library "/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/../jre/lib/server/libjvm.dylib" does not contain the JNI_CreateJavaVM symbol.
Also, there is another error message you might receive from Eclipse:
To open “Eclipse.app” you need a Java SE 6 runtime. Would you like to install one now?
I read through this bug report at eclipse.org - https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361 and that gave me some ideas as to how to workaround my Eclipse on Mavericks issues. Easy solution, download & install the Oracle JDK 7 and make sure to use the 64-bit version of Kepler. I have had Java 7 on the machine for a while and Java 8. I have historically used the 32-bit version of Eclipse which worked great with Java 6 which was the default from the Mac OS X perspective. Here is what I think happened, Mac OS X Lion (10.7) included Apple's Java 6 JRE, with Mac OS X Mavericks (10.9) it is no longer included. The Apple Java 6 supported 32-bit & 64-bit with a command line switch, Eclipse Juno & Kepler were seemingly able to handle that scenario. Now, Java 7 comes directly from Oracle and is installed separately on my box. In order to address the "you need a Java SE 6 runtime" specifically, I also needed to update your Info.plist in the JDK7 at /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Info.plist with the following in the JVMCapabilities section:
                JVMCapabilities
                
                        CommandLine
                        JNI
                        BundledApp
                        WebStart
                        Applets
                
Once the changes to Info.plist have been made you will need to reboot for it to take effect. Some other settings that might be important: JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home And I do not recall making any changes to Eclipse.ini that mattered, what follows is what I have right now on my machine, provided in case there is something tweaked in your installation. EDIT: It turns out that I did need to update my eclipse.ini, eclipse was picking up a Java 8 installation that I had and I needed to force it back to Java 7 as it was causing some other problems. Eclipse.ini for the 64-bit installation of Eclipse (underneath Eclipse.app-Contents-MacOS)
-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
Also, I did make the change recommended at Eclipse.org/downloads. It should be noted that you won't actually see something named "gatekeeper" in the UI.
Hopefully that helps, I spent plenty of time using Google looking at Bugzilla and StackOverflow entries but could not find something like this blog post that helped me address both issues (64-bit required, missing Java SE 6 runtime).