how to launch Talend studio using different java version

One Star

how to launch Talend studio using different java version

hi, i have Talend integration suite 4.2.4 installed on Mac os 10.8.4 with java 1.6.0_51, because there is a issue to start the Talend, i download java 7 and tried to launch Talend using java 7. in Talend-macosx-cocoa.ini, i specified the java home:
-vm
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java <-- java 7
-vmargs
-Xms64m
-Xmx768m
-XX:MaxPermSize=256m
then launched the Talend, but when i checked the .metadata/.log file, i saw it's still pointed to java 1.6.0_51:
!SESSION 2013-08-06 16:56:24.649 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_51 <-- still java 6
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -keyring /Users/dyi/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/dyi/.eclipse_keyring -showlocation
how can i make Talend use java 7 ? thanks
One Star

Re: how to launch Talend studio using different java version

Without knowing to much about OSX you can either export your java home variable or edit the startup script that launches Talend.
export JAVA_HOME=$(/path/to/jdk)
then PATH=$JAVA_HOME/bin:$PATH
or add the above to your startup script
You can also add alternative JDK's to the IDE in Window > Preferences > Java > Installed JREs
or Window > Preferences > (search for JREs)
NOTE: There is a difference to the JDK used in your projects to the JDK the IDE is using.
How you launch your IDE may affect this as well.
Check your ~/.profile but note that changes here will be system wide.
If you do the above in a terminal then this will not persist across restarts
This is more about how OSX operates rather than Talend

Graham
One Star

Re: how to launch Talend studio using different java version

i tried all the suggestions you mentioned,
updated .bash_profile to add Java_HOME and PATH;
updated startup script to added those two parameters;
specified JDK in IDE;
updated ~/.profile
none of them works, in the log file i still saw eclipse.buildId=unknown
java.version=1.6.0_51
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
One Star

Re: how to launch Talend studio using different java version

Did you source your .profile after updating?
To ensure you have the desired version of Java on your path
open a new shell and execute the following
javac -version
This will not persist across restarts however to confirm you have done this correctly.
export JAVA_HOME=/path/to/jdk
export PATH=$JAVA_HOME/bin:$PATH <-- ensure your new java home is in the front of your path.
echo $PATH <-- check for the java home variable
javac -version <-- check the correct version is displayed
Optionally $java -jar SomeExecutableJAR.jar will now use your jdk to execute
If all is good launch talend it should pick up the first java home variable as the javac command did in the previous step
This issue is really about your OS environment to confirm how it should be done google "setting java home on OSX"
Talend is just doing the same thing any other java application would, find $/JAVA_HOME/bin/java and use it to launch the IDE
If possible reset your Talend-Studio-xxx.ini file. For further advice on how to manipulate this file look at wiki.eclipse.org/Eclipse.ini however Talend may discourage editing this file beyond giving the JVM more memory etc. I would bet (Not tried this myself) you cannot add Lombok to the IDE here such as:
-javaagent:/home/graham/Apps/springsource/sts-3.1.0.RELEASE/lombok.jar
-Xbootclasspath/a:/home/graham/Apps/springsource/sts-3.1.0.RELEASE/lombok.jar
Now my STS will understand Lombok annotations off the bat Smiley Happy
I can use a getter and setter at design time on a class that has none. the getters and setters show up in code hints as well.
Graham