1

This question should be relevant to anyone who is interested in learning about the relationship between the versions of standard java objects and JDK version, and about how to rollback your java version.

So: how do I rollback a version of my java.util.Map object? I'm sure I'll have to rollback other objects as well.

I'm trying to follow these instructions (https://cloud.google.com/solutions/mobile/mobile-firebase-app-engine-flexible ), and when I try to get maven to run my local server or deploy to the cloud app engine, I see errors like these:

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
(default-compile) on project backend: Compilation failure [ERROR]
  C:\Users\bensw\AndroidStudioProjects\firebase-appengine-backend\src\main\java\com\google\cloud\solutions\flexenv\common\LogEntry.java:[23,17]
cannot access java.util.Map [ERROR]   bad class file:
/modules/java.base/java/util/Map.class [ERROR]     class file has
wrong version 55.0, should be 53.0 [ERROR]     Please remove or make
sure it appears in the correct subdirectory of the classpath.

I've found some postings here on this topic, but I'm not sure how to apply those answers to this situation. I'm not using IntelliJ, and I'm not sure of what SDK I need to change. Class file has wrong version 52.0, should be 50.0

I've tried switching back to Java 6, based on a guess that Java 6 has the right Map.class version, but to my surprise, that didn't work.

Thanks, Ben

gdlmx
  • 6,479
  • 1
  • 21
  • 39
Ben
  • 21
  • 3
  • Not really clear what you are asking.. – Daniele Mar 02 '19 at 00:17
  • 1
    This error means your runtime JRE version is different and incompatible with the JDK version you use to build this JAR file. – howie Mar 02 '19 at 00:48
  • 2
    That error looks like you are mixing parts of two different JDK versions, using the JVM from an older version with the bootstrap classpath (the runtime libraries) of a newer one. No idea how that would happen. How did you install/setup Java? – Thilo Mar 02 '19 at 00:49
  • How I installed Java is a little hazy. I think I could have had any number of JREs. When my computer asks me to update Java I don't pay attention to whether I agree to or not. I do know that I have an Open JDK of type OpenJDK-11.0.2. I included that one in my path. I've since uninstalled the two JREs I had from Oracle of version 6, I also had one of version 8, which are all uninstalled. I also wonder whether this doesn't have to do with the "app-engine-java" that comes with Google Cloud. I can't figure out how to rollback the version of that thing. – Ben Mar 02 '19 at 16:04
  • Also: I can't find older JDKs somehow. Even if I could find an older JDK, I'm not sure how I could map the JDK version to this 55.0 or 53.0 version number system. I asked Google tech support for help, supposedly they'll get back to me within a business day. – Ben Mar 03 '19 at 00:51

1 Answers1

1

Try using Java 8 instead of 11.

  • Install OpenJDK 8
    sudo apt install openjdk-8-jdk
    
  • Make sure you're using the right version of Java. You can use update-alternatives to choose the right Java installation:
    sudo update-alternatives --config java
    sudo update-alternatives --config javac
    
  • Make sure that JAVA_HOME points to the right JDK on your session:
    export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::")
    

Let me know if that works.

ricalo
  • 181
  • 1
  • 11