Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot fix project after choosing wrong java version to create the project. #2960

Closed
erluxman opened this issue Dec 11, 2019 · 3 comments
Closed

Comments

@erluxman
Copy link
Contributor

As there does not seem to any recommendation and restriction about the JDK version while creating the Codenameone project from Intellij Plugin.

There are two issues after that :

  1. It throws java.lang.UnsupportedClassVersionError.
  2. theme.res does not get generated.

I tried changing the java version from build.xml, updated the JDK version from Project Structure (Codename one does not seem to be affected by it) but it still throws the java.lang.UnsupportedClassVersionError.

I never reached a point where it threw error regarding theme.res's absence.

Is there any way to fix the project once it is created using the wrong/unsupported JDK version?
If there is not any, are there any plans to fix this in the near future?

What can be done to stop users from shooting themselves on foot by choosing the wrong JDK on the first place?

  • Providing a warning regarding JDK below 11 in the plugin project creation form?
  • Not accepting an unsupported JDK version from the dropdown?
  • Any other ways?
@shannah
Copy link
Collaborator

shannah commented Dec 11, 2019

JDK11 is supported. That's a red herring.

What is the full stack trace to the UnsupportedClassVersionError?

@erluxman
Copy link
Contributor Author

java.net.URISyntaxException: Illegal character in path at index 27: file:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar
    at java.net.URI$Parser.fail(URI.java:2848)
    at java.net.URI$Parser.checkChars(URI.java:3021)
    at java.net.URI$Parser.parseHierarchical(URI.java:3105)
    at java.net.URI$Parser.parse(URI.java:3053)
    at java.net.URI.<init>(URI.java:588)
    at java.net.URL.toURI(URL.java:953)
    at com.codename1.impl.javase.JavaFXLoader.addToClassPath(JavaFXLoader.java:296)
    at com.codename1.impl.javase.JavaFXLoader.addJavaFXToClassPath(JavaFXLoader.java:221)
    at com.codename1.impl.javase.JavaFXLoader.runWithJavaFX(JavaFXLoader.java:244)
    at com.codename1.impl.javase.JavaFXLoader.main(JavaFXLoader.java:323)
    at com.codename1.impl.javase.Executor.main(Executor.java:113)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.codename1.impl.javase.Simulator.main(Simulator.java:85)
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: javafx/scene/media/MediaException has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at com.codename1.impl.javase.JavaFXLoader$1.loadClass(JavaFXLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.codename1.impl.ImplementationFactory.createImplementation(ImplementationFactory.java:69)
    at com.codename1.ui.Display.init(Display.java:489)
    at com.codename1.impl.javase.Executor$3.run(Executor.java:245)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

@shannah
Copy link
Collaborator

shannah commented Dec 11, 2019

When does this occur?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants