GeneXus 15 + Google Cloud Deployment Error: Class file is Java 8 but max supported is Java 7 - google-app-engine

I have seen many answers in these forum, but none related to GX so far, and the ones I've tried haven't solved this issue.
When trying to deploy a GX 15 + JAVA + Web + Mobile I get the following error:
...
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109\WEB-INF\classes\com\proyecto02\gamcheckuseractivationmethod.class
Unable to update app: Class file is Java 8 but max supported is Java 7: C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109\WEB-INF\classes\com\proyecto02\gamcheckuseractivationmethod.class
error: C:\GeneXus\GeneXus15\DeploymentTargets\GoogleAppEngine\deploy.msbuild(4,3): error MSB3073: The command ""C:\android\engine\appengine-java-sdk-1.9.51\bin\appcfg.cmd" -A proyecto02 update "C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109" -V 3" exited with code 1.
Done Building Project "C:\GeneXus\GeneXus15\DeploymentTargets\GoogleAppEngine\deploy.msbuild" (Deploy target(s)) -- FAILED.
...
To build mobile apps GX 15 requires JDK 8.
Has anyone been able to deploy to Google Cloud?
Any suggestions to solve the error?

GeneXus Java generator does not require Java 8, it requires Java 6 or higher, Genexus Android generator requires Java 8.
Each generator has independent properties to set the JDK to be used, compiler options, etc. So, no matter you are using JDK 8 you are able to set "Java compiler options" (for Java Generator) as: -O -source 1.7 -target 1.7 in order to compile the application to run on 1.7 JVM (as explained here)
Another solution is to have both JDKs installed, to set JDK 1.7 path as Java Generator/Compiler path and JDK 1.8 path as Android/Compiler Path.

Related

java -jar payara-micro-4.1.2.181.jar throwing Cannot find javadb client jar file

I am getting the following exceptions
running ==>> java -jar payara-micro-4.1.2.181.jar
[2019-01-15T20:55:37.913-0800] [] [1;92m[INFO][0m []
[[1;94mfish.payara.micro.boot.runtime.PayaraMicroRuntimeBuilder[0m]
[tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1547614537913]
[levelValue: 800] Built Payara Micro Runtime
And also
[2019-01-15T20:55:43.539-0800] [] [1;92m[INFO][0m [NCLS-CORE-00046]
[[1;94mjavax.enterprise.system.core[0m] [tid: _ThreadID=1
_ThreadName=main] [timeMillis: 1547614543539] [levelValue: 800] Cannot find javadb client jar file, derby jdbc driver will not be available
by default.
I am using jdk 1.8.
The javadb client file exception is irrelevant to your actual problem. It is an INFO level message to tell you that it has looked in the default place for the Apache Derby database libraries, but hasn't found them. This default place only applies to Payara Server, not Payara Micro.
The actual problem you're seeing is in your comment. I can see that you are using a version of Java that includes the JPMS (module system). The modularity introduced in Java 9 is not compatible with your version of Payara Micro, so you will need a version of Java no higher than 8.
You may be able to start Payara Micro on Java 9+ by explicitly adding the java.se.ee module, but there was no change in 4.181 to allow Payara Micro to actually run correctly with JPMS, so it would almost certainly break if you tried to deploy any kind of complex app.
TL;DR: change to use Java 8 because Payara Micro 4.181 will not run on Java 9 or higher. And the javadb message can be ignored.
Note: Even though you say you are using Java 1.8, the stack trace proves that you are not. Double check your Java installation and make sure to definitely use Java 8.

Running app in IDE stops working

Last week I finished development on a test app and ran it successfully in all simulators.
Today I decided to look at publishing the app and used "Sent Android Build". Build status "Successful".
Then tried running jar from command line and got:
peter#PeteSuse:~> java -jar "/home/peter/NetBeansProjects/mobile-apps/pGame/dist/pGame.jar"
java.lang.ArrayIndexOutOfBoundsException: 0
at com.codename1.impl.javase.Executor$1.run(Executor.java:84)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
So tried to run from GUI and got:
run:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
at com.codename1.impl.ImplementationFactory.createImplementation(ImplementationFactory.java:69)
at com.codename1.ui.Display.init(Display.java:566)
at com.codename1.impl.javase.Executor$1.run(Executor.java:112)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
Java version:
peter#PeteSuse:~> java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (IcedTea 3.3.0) (suse-23.1-x86_64)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
I am using Netbeans (new to this) on Suse Linux 42.1 64b.
Have I lost a library somewhere? or something else?
Thanks guys. I fixed the problem by adding jfxrt.jar to the Libraries in NetBeans.
JFXPanel is in the JavaFX library.
See: JavaFX and OpenJDK for info on why JavaFX is not available by default in your OpenJDK distribution.
If your linux distribution makes an open JavaFX package available (like ubuntu does: Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)?), then you can use that.
Otherwise you can build from source (for the adventurous yak shaver).
Or, easiest, is just to an Oracle Java distribution.
I don't know codenameone or have any idea how it works. Possibly whatever it is, you could ask the creators to package their thing as a self-contained application, so that it ships with a compatible Java runtime, which would (potentially) avoid issues such as you are encountering. Not knowing codenameone, I don't know if that would make sense or not.
I also don't know the cause of your original ArrayIndexOutOfBoundsException as that looks internal to codenameone or your use of it.
With regards to NetBeans, you might need to set the Java platform to one with JavaFX installed (in case you have multiple Java platforms installed on your machine).
You can run a Codename One application in the simulator by pressing the play button in the IDE. It won't work for you from Command Line and shouldn't since the app shouldn't have a main() method.
You can execute the Codename One simulator from Command Line using:
java -jar JavaSE.jar:dist/MyApp.jar
Notice this assumes your project is the working directory.

Issues with Marionette.Upgrade on Windows 7 when upgrading from Marionette 1 to 2

I'm trying to use https://github.com/marionettejs/Marionette.Upgrade on Windows 7 to upgrade a Marionette app I built in 1.6.2 to 2.
I've installed Python 2.7 and changed upgrade.py from codemod = "%s/bin/codemod.py" % path.dirname(file) to codemod = "C:\Python27\python.exe" based on other issues people have had with Upgrade on Windows.
However, I'm getting some errors I can't fix (I haven't used python before) and there are no changes when I ask for the replacement.
The command I use is python C:\web\Marionette.Upgrade\upgrade.py C:\web\tl-git\app\webroot\js\apps\client\lists and the errors I get look like
')close\' is not recognized as an internal or external command, operable program or batch file. C:\Python27\python.exe: No module named --extensions
Anyone have any suggestions?
The following image shows the error and also the python info on my Windows installation:

Google App engine Deploy Exception : Cannot get the System Java Compiler. Please use a JDK, not a JRE

Error message :
------------ Deploying frontend ------------
Preparing to deploy:
Created staging directory at: 'C:\Users\JAMESY~1\AppData\Local\Temp\appcfg5730205859174689794.tmp'
Scanning for jsp files.
Compiling jsp files.
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Debugging information may be found in C:\Users\James Yang\AppData\Local\Temp\appengine-deploy1938777867658475857.log
I have added
-vm
G:\Jdk8\bin\javaw.exe
in eclipse.ini
and My java_home is G:\Jdk8\bin\
Make sure you have the Java Development Kit (JDK) installed in your computer.
Check if you have Java 8 installed, while trying to compile with Java 7, or viceversa. In other words, check if the JDK is set to the wrong version.
Make sure the JDK is FIRST in your Path, by placing %JAVA_HOME%\bin at the beginning of your Path in your System variables.

appcfg.cmd java version; 1.7 installed; 1.6 in path; tells me it needs 1.6 ti yokiad

I try to use this command to deploy my application to
appspot.google.com:
c:\a\appeng\bin\appcfg.cmd --use_java7 update c:\a\u3e
Generates the error messsage.
C:\a>c:\a\appeng\bin\appcfg.cmd --use_java7 update c:\a\u3e
Registry key 'Software\JavaSoft\Java Runtime Environment\CurrentVersion'
has value '1.7', but '1.6' is required.
Error: could not find java.dll
Error: could not find Java SE Runtime Environment.
I tried setting the path to use the Java 1.6 SDK we downloaded
but that did not help or change any thing.
The web resources talk about what version of Java is used
by the application once it appears on Google's servers; I
did not see anything about the Java version for the upload
process including developers.google.com/appengine/docs/java/gettingstarted/uploading and developers.google.com/appengine/docs/java/tools/uploadinganapp#Command_Line_Arguments as well as searching this site specifically and checking google.
Can I deploy
an application from the computer in my house without
deinstalling the Java 1.7 I use for other purposes?
Thank you for looking at this question. I resolved the problem. It was not related to Google Application Development
Server. It was a difficult-to-resolve path problem to the directory where the Java executables were kept.

Resources