We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › which jdk is the pde using
Page Index Toggle Pages: 1
which jdk is the pde using? (Read 2045 times)
which jdk is the pde using?
May 27th, 2008, 6:31am
 
I've just installed a new jdk, 1.5, onto my system, and was wondering how to configure the PDE to use the older 1.4.2 jre. There doesn't seem to be any preference settings to do this.

Re: which jdk is the pde using?
Reply #1 - May 27th, 2008, 9:43am
 
If you've got the normal version of Processing, it uses the 1.4.2 jre in the processing/java folder.

If you're using the expert version on windows, or using a different OS, then I believe processing uses the first version of Java found in the PATH.
Re: which jdk is the pde using?
Reply #2 - May 27th, 2008, 11:25am
 
First question: why? I run Processing with Java 1.6.0_05 without problem. Should work with 1.5 too.
Next, from what I see with the C launcher (Windows version, you didn't tell which system you use), if you have installed Processing with its own copy of Java, it will just use it.

You probably already know the trick, but if you want to be sure which version it uses, paste this in a new sketch and run it:
Code:
String p = System.getProperty("java.version") + " | " +
System.getProperty("java.home") + " | " +
System.getProperty("java.vendor") + " | " +
System.getProperty("java.vendor.url");
println(p);

It shows that, in my Java-less installation, it doesn't use the JRE in the path (old version of 1.6) but the latest I installed. Actually, it uses the javaw.exe which is in C:\Windows\System32\
Which is curious, because the old JRE is before this one in the path, and when I type java or javaw on the command line, I invoke the old one. Perhaps ShellExecuteEx first looks in Windows directories before looking in the path.

All this so you are aware of possible issues with the path.
Re: which jdk is the pde using?
Reply #3 - May 27th, 2008, 6:39pm
 
That's a great tip! I've forgotten all about the system properties. Yeah i'm on windows with the java-less install. I wasn't too troubled at first about which jre the pde was using, but i've installed the jdk for use with mobile processing and was a little worried that it might clobber my pde install.

Re: which jdk is the pde using?
Reply #4 - May 27th, 2008, 7:56pm
 
disablek wrote on May 27th, 2008, 6:31am:
I've just installed a new jdk, 1.5, onto my system, and was wondering how to configure the PDE to use the older 1.4.2 jre. There doesn't seem to be any preference settings to do this.


the way to do it is to use the version of processing that includes java. (which is the java-less version plus a subfolder named "java" that contains a 1.4.2 jre.)
Re: which jdk is the pde using?
Reply #5 - May 27th, 2008, 7:58pm
 
PhiLho  wrote on May 27th, 2008, 11:25am:
You probably already know the trick, but if you want to be sure which version it uses, paste this in a new sketch and run it:
Code:
String p = System.getProperty("java.version") + " | " +
System.getProperty("java.home") + " | " +
System.getProperty("java.vendor") + " | " +
System.getProperty("java.vendor.url");
println(p);

It shows that, in my Java-less installation, it doesn't use the JRE in the path (old version of 1.6) but the latest I installed. Actually, it uses the javaw.exe which is in C:\Windows\System32\
Which is curious, because the old JRE is before this one in the path, and when I type java or javaw on the command line, I invoke the old one. Perhaps ShellExecuteEx first looks in Windows directories before looking in the path.

All this so you are aware of possible issues with the path.

this will do the same thing:
println(javaVersion);  

not sure about the windows path issue since i'm not much of a windows hacker; but that would be consistent with reports re: path issues and the jdk in use.

there's also the java preferences control panel, where you can set the default jre. not sure whether that would change things for ShellEx or not.
Re: which jdk is the pde using?
Reply #6 - May 27th, 2008, 9:59pm
 
fry wrote on May 27th, 2008, 7:58pm:
this will do the same thing:
println(javaVersion);

Ahah, an undocumented trick.
But it displays 1.6 where my snippet displays a bit more information:
1.6.0_05 | C:\Program Files\Java\jre1.6.0_05 | Sun Microsystems Inc. | http://java.sun.com/
Cheesy
Of course, in lot of cases, the 1.6 info is more than enough.
Page Index Toggle Pages: 1