Visitar URL original
`StringIndexOutOfBoundsException` on PApplet initialisation when using EA versions of Java · Issue #142 · processing/processing4 · GitHub
The Wayback Machine - https://web.archive.org/web/20201107175234/https://github.com/processing/processing4/issues/142
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

`StringIndexOutOfBoundsException` on PApplet initialisation when using EA versions of Java #142

Open
lenrik1589 opened this issue Oct 5, 2020 · 4 comments

Comments

@lenrik1589
Copy link

@lenrik1589 lenrik1589 commented Oct 5, 2020 •

Description

Expected Behavior

you can make a PApplet with Java 11+.

Current Behavior

On early access or preview versions creating PApplet fails with StringIndexOutOfBoundsException "index -1 out of bounds for length 0";

Steps to Reproduce

1.get yourself a copy of processing.core and Java 15+ (early access version of java);
2.create a class, extending processing.core.PApplet (normal sketch);
3.try to run this sketch.

Your Environment

  • Processing version: 4.0a using Intellij IDEA Community Edition
  • Operating System and OS version: Ubuntu 20.04 with kde plasma
  • Other information: Java 15/16

Possible Causes / Solutions

probably have default value for javaVersion and javaPlatform in case System.getProperty("java.version") returns something not expected

@lenrik1589
Copy link
Author

@lenrik1589 lenrik1589 commented Oct 5, 2020

after updating all the libraries to those, provided in 4.2a (on Java 14), PGraphics2D does not implement getNative (just returns null) so PSurfaceJOGL.setCursor(PImage image, int hotspotX, int hotspotY)` just throws NPE

@benfry benfry changed the title Using EA versions of Java crashes on PApplet class initialisation `StringIndexOutOfBoundsException` on PApplet initialisation when using EA versions of Java Oct 6, 2020
@benfry
Copy link
Member

@benfry benfry commented Oct 6, 2020

Ok, though this is going to be a low priority; only Java 11, the LTS, is supported.

@lenrik1589
Copy link
Author

@lenrik1589 lenrik1589 commented Oct 12, 2020

Another solution i can think of would be to catch this error and display a warning, like "you are currently using unsupported version of java, consider switching to java 11" and probably also a link to download location.

@benfry
Copy link
Member

@benfry benfry commented Oct 13, 2020

Are you sure you're using the version of the “core” classes from this repo? The 3.x code will definitely do this, but I don't see anything obvious for why 4.x would be failing.

What JDK is this using?

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.