jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

Illegal Reflective access Operation has occured #237

Closed Jarmahent closed 6 years ago

Jarmahent commented 6 years ago

Running on Ubuntu 18.04.1 LTS Headless

Running: java -jar processing-py.jar template_letters.py

Throw warning, program runs succesfully but just letting you guys know.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.python.core.PySystemState (file:/root/ImageProcessingBot/processing_handler/processingpy/processing-py.jar)
to method java.io.Console.encoding()
WARNING: Please consider reporting this to the maintainers of org.python.core.PySystemState
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Sketch thats running looks like this:


def setup():
    global mosaicSize
    global pixelSkip
    global alphabet
    global alphabetSplit
    global img

    pixelSkip = 10
    alphabetSplit = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

    img = loadImage("media/preprocessed/preprocessed.jpg")
    noStroke()
    this.surface.setSize(img.width, img.height)

def draw():
    background(0)
    for y in range(0, img.height, pixelSkip):
        for x in range(0, img.width, pixelSkip):
            c = img.get(x, y)
            fill(c)
            random_letter = alphabetSplit[int(random(len(alphabetSplit)))]
            textSize(15)
            text(random_letter, x, y)

    save("../../media/processed/processed.png")
    noLoop();
    exit()
jdf commented 6 years ago

Command-line use of Python Mode is no longer supported; it works as-is.

If you use the --illegal-access=permit argument to java, that should silence the warning.