2

I'm using Processing 1.5.1 for Mac OS X El Capitan and when I run some code on my app it displays that message. When I type java -version I get:

java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)

and when I type /usr/libexec/java_home -V I get:

Matching Java Virtual Machines (3):
1.8.0_65, x86_64:   "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
1.6.0_65-b14-468, x86_64:   "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_65-b14-468, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home

I've tried setting JAVA_HOME to:

export JAVA_HOME=`/usr/libexec/java_home -v 1.6.0_65-b14-468`

but still when I reopen Processing it still displays the same error. Any help or suggestions to force it to run JVM 32-bit?

Eric Reyna
  • 181
  • 1
  • 3
  • 13
  • Is there a reason you're using version `1.5.1` instead of `2.2.1`? Also, Processing comes with its own version of Java, doesn't it? So it shouldn't really matter what Java you have installed. What happens when you uninstall Java completely? I don't really know much about macs, but it sounds like you've got a bunch of different Javas installed. If I were you, I'd try uninstalling them first. – Kevin Workman Jun 30 '16 at 13:12
  • I can install version 2.2.1 but not sure if it supports OpenNI. I will try and let you know. – Eric Reyna Jun 30 '16 at 13:25
  • **Actually it works!!!!** thanks! I just installed 2.2.1 and the library works and the JVM has been able to run 32-bit I guess – Eric Reyna Jun 30 '16 at 13:34
  • Okay cool. I'll add an answer that gives a little more detail. – Kevin Workman Jun 30 '16 at 13:39

2 Answers2

1

Selecting JVMs on a mac is a pain. I use Jenv. You could try using jenv to select a specific Java version.

brew install jenv

or have a look here:

http://www.jenv.be/

You need to register your JVMs to set it up but you can then set a default JVM and also a default local JVM for a particular directory. Very handy.

You might need to run the following correctly set JAVA_HOME:

jenv exec [your app]

Good luck.

1

Processing 1.5 is pretty old. I wouldn't use it unless you have a very specific reason to do so. And even then, you should probably try to find a workaround.

Instead, you should try to use the latest version of Processing (right now, version 3.1.1) if at all possible. But you're using a library that hasn't upgraded yet, so you have to rely on 2.2.1.

Version 2.2.1 added a bunch of stuff over Processing 1.5, including:

Better 32 and 64-bit support. We now support separate 32- and 64-bit libraries and have added separate 32- and 64-bit versions of the Processing download. On Mac OS X, you can even select which mode you'd like to use.

I don't know if this is exactly what fixed your problem, but I would bet that Processing 2.2.1 added something that fixed the issue.

As soon as your library upgrades to Processing 3, you should upgrade your Processing version.

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107