I have been running Processing 2.2.1 on a Macbook Pro 2014 with the processing.video library no problems. I am now moving the project to a Mac Pro (tower) 2017 model. Importing the processing.video library doesn’t bother it. Creating a variable of the class Capture doesn’t bother it:
However, as soon as I try to use that variable, like this:
I get the following error:
“Could not run the sketch (Target VM failed to initialize). Make sure you haven’t set the maximum available memory too high.”
I’ve seen this error before, such as when trying to use the fullscreen() function with a renderer (P3D/P2D/OPENGL) argument in Processing 3 (it is partly because of this problem I am using Processing 2.2.1).
Does anyone have any thoughts?
even if processing 2.2.1 might be still supported
you should think about using / and learning / current 3.5.3 version
and upgrade your code too to the current version.
but for the main question
errors when using a library?
when working with different versions must use different sketch_book setups
as the loaded ( and valid ) libraries are part of that path.
most probably you mixed new processing version with old libraries when copy
that whole sketch_book path to new computer?
Thanks for the advice kll. The project this code is part of uses a number of libraries that are not supported by Processing 3.x and for which there are no current equivalents, so it needs to use 2.2.1. For other projects I use 3.x as well as P5.js, so I’m quite familiar with the different flavours.
I have another more recent project that uses the same libraries as the one I am having problems with (the problem file uses one extra library, processing.video). When I add it to the newer project I do not get the error. I think the best way forward is to strip out code I am not using in the problem project from the newer project and then step by step add the code that is distinctive to see if and when it breaks. Both are very complicated projects with many classes, using physics engines, live video, kinect input and other elements.
I note that the Target VM error also occurs in Processing 3.x with certain bits of code, especially the fullScreen() function. Looking at other’s discussion of this it seems to arise with certain versions of Processing, OS’s and graphics cards. That can make things hard to fix, especially as there is so little documentation, and some approaches become impossible in certain contexts, which is very frustrating.
Were you able to resolve this? If not, can you post the full error text?
The project has thousands of line of code. Runs fine on the development machine. Just doesn’t run on other machines. No useful error text - just says “Could not run the sketch (Target VM failed to initialize). Make sure you haven’t set the maximum available memory too high.”
My suspicion is that it is a dependency issue rather than a code or version issue. For the moment I am continuing to develop on the development machine. I know it is when I invoke the processing.video library that the project breaks, so it’s to do with that. As kll pointed out, it’s probably a path issue, although I’ve tried re-importing the library and that didn’t fix it. That was confusing.
I am failing to run GettingStartedCapture.pde, listing:
Processing video library using GStreamer 1.16.0
Could not run the sketch (Target VM failed to initialize).
I got there after trying to run TimeDisplacement.pde and failing at line 22
I am using:
Processing Video: v2.0-beta4
MacOS: v10.14.6 (Mojave)
Any help is appreciated.
did you get an answer for your problem. Because im facing this same error
this works for me!