Trying to get started with Google App Engine - does it work with Java 8?
I've followed the instructions on this page:
https://console.developers.google.com/start/appengine
Selecting 'Java', I successfully completed the Maven build, but when I visit localhost:8080 nothing is running.
The instructions say "make sure you have Java 7 JDK installed" however I have just installed Java 8 JDK.
Do I need to separately install Apache?
Java 8 is now generally available on App Engine Standard Environment, joining the GA runtime on the App Engine Flexible Environment.
Learn about the differences.
The new Java 8 runtime has all the benefits of Java 7 but with upgrades and enhancements:
OpenJDK 8-based Java runtime supports the standard public Java
library (no whitelist)
Doesn't impose a security manager--your code won't be restricted by Java permissions issues.
Not at the time of writing but you can keep track of the status in this issue:
Java 8 support: https://code.google.com/p/googleappengine/issues/detail?id=9537
[The passage of time has changed the 'no' from this accepted answer to 'yes'. Please see others answers below.]
Short answer, no. They will integrate it over time, but for now if you use it, it will cause you a lot of errors. I would recommend against it
Also take note of user7610's answer below :). It is as of now the only way to have Java 8 on the Cloud Platform
Update: it is available in the "standard" (sandboxed) offering since mid 2017, https://cloud.google.com/blog/products/gcp/java-8-on-app-engine-standard-environment-is-now-generally-available
Before then, it was sort-of available, via Managed VMs. The idea is that you provide a Docker container with whatever software you need (like Java 8) and GAE will use that as your app instance VMs. You still get the autoscaling, monitoring and all that.
The disadvantage of Managed VMSs is that you are charged as for the Compute Engine VMs. That means you pay by minute and there is no free quota. There is the $300 credit for new user accounts for 60 days, but after that you'd have to pay.
If your interest is in using lambda expressions on Google App Engine, you could give Retrolambda a try. I haven't tried it yet, but it claims to backport Java 8 lambda expressions to Java 7.
Google App Engine Java 8 support is generally available as of Q3 2017. https://cloud.google.com/appengine/docs/standard/java/runtime-java8
It's not quite the same thing, but you can use Java 8 with the new App Engine "flexible environment". I don't think you can access App Engine APIs (such as the images service or task queues) but you'll be able to use services which live outside of App Engine, such as the Datastore and Pub/Sub.
It's also worth bearing in mind that the service is currently in beta (so not covered by any SLAs). Also, the pricing is different; instead of using the normal App Engine pricing structure, it's based on usage of GCE virtual machines.
yes it does. We just launched this to Beta and soon GA.
https://cloudplatform.googleblog.com/2017/06/Google-App-Engine-standard-now-supports-Java-8.html
App Engine Standard Java now supports Java8.
See the Beta documentation at: Java8 on GAE Standard documentation
Thanks
Add <runtime>java8</runtime> to your appengine-web.xml file.
Yes, using App Engine flexible environment. Here are the official docs:
https://cloud.google.com/appengine/docs/flexible/java/
And here is the github repo for this implementation:
https://github.com/GoogleCloudPlatform/appengine-java-vm-runtime
You can apparently use JDK8 to create JRE7 compatible byte code, and this seems to be what Google recommends: https://cloud.google.com/appengine/docs/standard/java/download
-source 1.7 -target 1.7
Yes, You can use flexible environment. and change setting of your app.yaml
vm: true
for more information study https://cloud.google.com/appengine/docs/flexible/
Related
Some weeks ago I wrote a little Java program showing a real time plot chart (i.e. records with tracking of current time), with a modest 25 kbps streaming rate, 20fps framing rate, and no relevant user interaction. Thinking on its eventual deployment as a Mobile App, a Web Server chart or simply as a PC as a program, being Java a perfect selection for me.
Before starting now the Web version of this program, i started to investigate and according the 2016 Oracle White Paper Migrating from Java Applets to Plugin Free Java Technologies:
The deprecated plugin technology will be completely removed from the
Oracle Java Development Kit (JDK) and Java Runtime Environment (JRE) in a
future Java release (TBD). Java Web Start applications do not rely on a
browser plugin and will not be affected by these changes.
And according 2019 OpenWebStart:
Java Web Start (JWS) was deprecated in Java 9, and starting with Java
11, Oracle removed JWS from their JDK distributions
And then I get lost.
Hence, which is the way to go with a Java program like this? Which is the proper sustainable Java way to do this (and not subject to something like what happened to Java Web Start)?.
Or should I simply move to another way to do it, now that the program is in its infancy, considering I am not precisely a fan of Phyton, considering PHP is not precisely the way for programming these kind of numerical things, and considering I am not so willing to give Microsoft technologies a chance?
It is not a problem for me to adapt and rewrite my current code if necessary, but possibly not doing this every 5 years.
Which article would you recommend me to get back to the proper path?
Thanks in advance.
The easiest and highest-performance option is TeaVM, a transpiler that converts Java classes into JavaScript. Your code then runs in the browser natively without any plugin.
Read an introductory article here: https://blogs.oracle.com/javamagazine/java-in-the-browser-with-teavm
TeaVM's main site is here: http://teavm.org/
Thinking on its eventual deployment as a Mobile App, a Web Server
chart or simply as a PC as a program, being Java a perfect selection
for me.
(..)
Hence, which is the way to go with a Java program like this? Which is
the proper sustainable Java way to do this (and not subject to
something like what happened to Java Web Start)?
Two lines of Java
What happened is that our old friend, the Java Standard Edition, split into two lines:
Oracle Java SE ("commercial Java"): needs paid license for commercial use for releases since April 16th, 2019
OpenJDK ("open source Java"): open source (GPLv2 with linking exception), does not contain Oracle's Java Web Start implementation
The Oracle Java SE version keeps Java Web Start and Java FX available and supported only for Java SE 8. Newer Java versions, esp. Java SE 11 do not carry these anymore.
It is not a complete client / desktop technology removal, because Oracle, according to the Java Client Roadmap Update 2018, continues to support AWT and Swing for at least 5 more years on both Java SE 8 and Java SE 11.
You can continue deployment via Java Web Start
Open source Java got a decent implementation of Java Web Start, which is free and available for Java SE 8 and newer Java versions like Java SE 11.
This is Karakun's OpenWebStart based on Red Hat's IcedTea-Web, now beyond version 1.0, which you already found.
Continued support is not guaranteed but seems likely. So you might continue on this track.
Or you might deploy via an app store
Oracle's explanation for dropping Java Web Start was, that they want to change the deployment model to applications with bundled runtime:
As client application development continues to shift from the old
“plugin” world to modern deployment, the need for a standalone Java
Runtime Environment (JRE) that is installed centrally, separately from
Java applications has diminished. Using the ‘jlink’ tool introduced
with JDK 9 will make it even easier for application developers to
package and deploy dedicated runtimes rather than relying on a
pre-installed system JRE.
(Source: Faster and Easier Use and Redistribution of Java SE)
Deployment, according to Oracle, would occur via some app store like the iTunes Store:
No doubt this was true, but the OSes have shifted hard and fast away
from this model. The "app store" model is now it. macOS has been
ratcheting this down hard for several years now. MSFT -- even in the
enterprise market -- has signaled this direction as well. For sure we
need to find options to support the legacy, but the future here is limited.
(Source: OpenJDK discussion mailing list)
Note that Java Start Web Start handled the updating of available new versions of applications on the client machines, and so do typical app stores.
Of course you can serve a version of your app with bundled runtime on your web site, but then you usually have to implement some mechanism to handle updates of your application on the machines of your users yourself.
What to choose?
It is true that the separate JRE installation has disadvantages, e.g. I changed my JRE recently and suddenly the IDE for Java did not work anymore. :-)
Moving deployment from a web site you control to an app store controled by the OS vendor or mighty players like Valve, has its own challenges. E.g. access restrictions, fees, release delays because of the review process, or they might not like your app for some reason and will not publish it.
Then adoption: Personally I have seen private use of app stores mostly on mobile devices and macs, but no use in companies yet. This might be a factor in your decision which road to pursue.
I've missed the Java on browser too. Because of curiosity I just developed an "JVM-Server", which precompiles the Java-Classes to native JavaScript and serves them to a WebBrowser.
Look here is a Hello World example application which is running on Browser:
https://github.com/neo-expert/jsjvm_helloworld
There is also a Library which implements WebGL bindings. In the above Example is a WebGL demo included, where a 3D cube will be rendered. The code is written in pure Java.
Is it a swing app? Will have to map that to a web (html) app to make it work on a browser nowadays.
You cannot run any of those programs from a browser directly.
Java used to java applets and java web start - where the browser helped you install a java app on local system but user had to seperately have installed JRE (Java run time) to run it locally.
Now all we have are web apps. basically apps that might have a a session, login, authenticaiton and authorition but in the end the app outputs HTML, Javascript, images and text data (JSON. XML etc) that is rendered on the web page.
Look at J2EE. I'm a java fan. but it takes longer to develop, but i think it runs better. Especially with a good framework like Spring Boot (it includes MVC see https://dzone.com/articles/7-best-java-frameworks-for-2016)
But learning curve is there. Buy a book or do a course online like udemy or similar.youtube has free videos. but not sure of the order/ quality.
If you choose php - many free and cheap servers like x10hosting to start with and learning curve is less too. Good framework - packages like drupal and wordpress.
On the browser HTML, Javacript run. There are frameworks for this too. Like gogole's angular https://angular.io/ this too needs a book/seperate study. Old days we used to use simple Javascript ...
For mobiles - sometimes can get away with using a URL OR there are frameworks that wrap a web page in an 'app' for android, iphone etc OR make a native app - but then will have different code bases.
I know someone who used a game engine to make a mostly single code base (some classes are specific to each platform like android, iphone) but used to render business graphs and a few interaction use cases (about 40). He used https://libgdx.badlogicgames.com/
As your research already revealed, Java is not a relevant web frontend technology anymore. Prefer Javascript and CSS for browser frontends, instead. Feed the frontend code with data served by Java backend services. The Java Servlet Specification is still the base for server-side Java. Many frameworks (like Spring or Jersey, to name a few) are build on top of it. Either chose one of these frameworks, or - for really simple use-cases - build an application only with plain servlets. Any servlet needs to be deployed in a servlet container (e.g. Apache Tomcat).
Your Java code needs probably some refactoring in order to provide an API for the web. As you are asking for near-realtime communication, you should have a look at the WebSockets standard which is designed for bidirectional and fast client-server-communication on the Internet and supported by all modern browsers (nice intro explaining the difference to WebRTC and arguing why WebSockets are often the better choice). To plot your data in a browser with Javascript and SVG, have a look on the D3.js library. A quick search brings you to demos like this one: D3 Real Time Chart. Also, there are other libraries that are built on top of D3, for example plotly.js.
Summary:
Java is fine for web backend services.
Your code needs refactoring to serve a backend API, preferably WebSockets. (introduction on how to start in Java at https://www.baeldung.com/java-websockets)
Get familiar with a Javascript browser plot library, such as D3.js.
My application is developed in java Swings which is 20 years old. For this huge application we are migrating the same on JAVA 10 now and will migrate the same on java 11 or upcoming versions. This application is working fine with java Webstart and as per the java 11 features, java Web Start application will not be supported in java 11 and other coming versions.
Please let me know the best way to run my application on java 10 with out webstart.
There is OpenWebStart start project. It says:
we decided to create OpenWebStart, an open source reimplementation of
the Java Web Start technology. Our replacement will provide the most
commonly used features of Java Web Start and the JNLP standard, so
that your customers can continue using applications based on Java Web
Start and JNLP without any change.
At the moment the project is alpha phase. Download is available. Beta should be available by the end of the year:
Our goal is to have beta tests and a release candidate ready in
Q3/2019
One solution might be the WebStart replacement that Karakun is currently working on: https://dev.karakun.com/webstart/
Currently it is not clear when and how this will come since it is based on a kind of crowd-founding but since everyone can get involved (even with low cost) this is a very good possibility.
Since this is a duplicate of Applet/JNLP on Java 11 migration I just copied my answer
Use Getdown which is a system for deploying Java applications to end-user computers, as well as keeping those applications up to date.
It was designed as a replacement for Java Web Start due to limitations in Java Web Start's.
You can read more on https://github.com/threerings/getdown
You will have to find an alternative technology to JWS/JNLP to run your system, as JWS/JNLP will no longer be available.
I don't have a clear cut alternative, the few companies still using JWS tend to be working to develop their own replacements for internal use.
I know this may not be what you want to hear (that there is no out of the box replacement available) but that's the way it is. Project I'm working on is in a similar conundrum, we also have several JWS components that will need to be reworked in the near future.
Cucumber-JVM has dependencies on Java 1.6
My client's application runs on Java 1.5 and this can't be changed at the moment
Does anyone know a way to use Cucumber-JVM to exercise my client's application?
I also posted this question on the Cukes mailing list (https://groups.google.com/forum/#!topic/cukes) where I got a response from Aslak Hellesøy (CUcumber's creator):
Me:
Is there any reasonable way to use Cucumber-JVM, built under Java 1.6, to develop a Java application that must run on JRE 1.5?
Aslak Hellesøy:
Short answer: No.
Long answer: Try it and share the problems you experience, then we can talk about whether it's possible to work around them.
We are starting some new app development but because of special business requirements, need to support back to Mac OS X 10.3 as well as PPC/Intel CPUs.
The latest Xcode 4 isn't an option, from what I can tell it only goes back to 10.5 and doesn't support PPC at all. Is Xcode 3 an option? Would it be easier to just use Java?
P.S. From anyone experienced in either, can you please comment on some of the pros and cons you've bumped into?
EDIT
As requested, here's a brief overview of the app:
The app needs to talk to a server which will expose JSON web services. The app itself needs to be built in a way that will allow plugins (not 3rd party, but in-house with the ability to customize which features the customer owns). Each plugin will gather specific information about the host OS - such as running apps, users, CPU usage, etc.
If you can find a way to make Objective-C work with your requirements, it is worth it in my opinion.
I myself am a former Java developer who has moved into the creation of native Mac OS and iOS apps. I tried using Java for some of my early Mac OS projects and always found the support to be lacking. It can be done, but it was always more difficult than it should've been and never worked as well as a native app.
Here is a link to another SO post that describes some workarounds for getting older SDK versions working in Xcode 4. I can't vouch for how well they work with current versions of Xcode, but it's worth trying.
In view of your requirements, especially the need to do some system evaluation, I would strongly recommend to use Objective-C and the Apple development environment. You will have a lot of difficulties using Java to retrieve the neccessary information about the host OS, that you want to use in your application.
You could try to run Xcode with older SDK versions, but I have virtually no experience on OSX to give you solid advice on how to do this.
EDIT: My Xcode 4 gives me an option to select a "Deployment Target", where I can go back to supporting 10.1, but I have no idea, if this is the right thing...
Well,
Apple isn't a Java friendly company. You don't have all the bindings you may need on their JVM.
So I strongelly recommend (given that your project will be Mac OS X only) Objective C instead of Java
I program in Java but on Mac OS X, Objective-C is better than Java because it is faster and developed by Apple itself. Moreover, if you develop a program in Objective-C, you can sell it on the Mac App Store while if you develop it with Java you can't.
So go with Objective-C.
Where can I see statistics about the most used Java versions?
(I want to develop applications that will run on most systems)
According to StatOwl, Java 6 has reached a 70% adoption rate.
Version 1.6, update 11 enabled background upgrades so it will always be current. 70% of java installs are version 1.6. Stick with 1.6
http://www.statowl.com/java.php
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Unfortunately a high percentage of system have very old versions of Java or no Java at all.
I suggest you develop for Java 5. Any system which doesn't have this at least probibly should have it installed.
You can make use of Google trends, they have a nice graphical view as well.
It wont show you the most used, but it will show you the most popular according to Google searches etc.
Java 5 has been deprecated for a full year now at this point, leaving Servers that still run it at a full year of security issues that are not patched, and never will be. I'd say stick with Java 6. We don't write Software with Windows 95 or OSX 10.3 in mind either, do we? Sometimes it is time to tell the users to update their software.
Java Tools and Technologies Landscape Report 2016 (Zeroturnaround): https://zeroturnaround.com/rebellabs/java-tools-and-technologies-landscape-2016/#java-versions
Java version and vendor data analyzed 2017 (Plumbr): https://plumbr.io/blog/java/java-version-and-vendor-data-analyzed-2017-edition