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 & HelpPrograms › Bundle Java with the App
Page Index Toggle Pages: 1
Bundle Java with the App? (Read 882 times)
Bundle Java with the App?
Jun 25th, 2009, 7:19am
 
I'd like to copy my Processing App to several systems that rely on Java 1.4 for some app, and the IT staff has not approved installing a newer version of Java.  Is there any way to bundle a newer version of java with the processing app so that it doesn't rely on the system but uses it's own copy?
Re: Bundle Java with the App?
Reply #1 - Jun 25th, 2009, 9:29am
 
From what I understand, Java is a self contained folder and does not need an installation, so long as you direct your jar files to use the specified folder.  So, I should be able to copy the JRE folder right into my sketch directory, and then somehow tell the sketch to use that copy.  Here is a simple example: jre/bin/java -jar myJar.jar

However, this doesn't work when I try to execute the jar on windows.  It's missing the main.. and I guess the arguments file.  I'd like to have this compiled right into the exe, where I tell it the JRE bin folder is in the sketch directory.
Re: Bundle Java with the App?
Reply #2 - Jun 25th, 2009, 1:08pm
 
I do that in an application we develop at work: it comes with its own JRE, so it doesn't change anything on the install computer (it is installed with InnoSetup).
From memory, we start it with batch files with a line like:
<path to JRE>/bin/javaw.exe -Djava.ext.dirs=<path1 to libs>;<path 2 to other libs>;<path to the main jars> class.path.to.MainClass parameter for application
Works fine...
Re: Bundle Java with the App?
Reply #3 - Jun 25th, 2009, 2:19pm
 
Thanks!  That did it. Smiley
Page Index Toggle Pages: 1