Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to set java version in the exported autonomous (batch file) job

Can we set the java version in batch file which is exported as autonomus job?

 

Also, If i have java7 and java8 installed, how come changing the compliance level from studio makes the difference in using java version while running the job from console and from studio?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Here is how you can set the versions of Java inside your bat file. It is important to note that the best Java version to use is the JRE that comes with a JDK. This is a weird requirement (and may actually not be essential anymore....but it was, so I always use it) Anyway, your bat file will start like this.....

 

%~d0
cd %~dp0
java -Xms256M -Xmx4096M -cp .;../lib/routines.jar..........etc

Edit it to point to your JDK's JRE, like this....

 

%~d0
cd %~dp0
"C:/Program Files/Java/jdk1.8.0_91/jre/bin/java" -Xms256M -Xmx4096M -cp .;../lib/routines.jar..........etc

Note, that I am pointing my my JRE there. You will have to tailor it to your machine's JDK's JRE location.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hello,

For your question 1, do you want to specify another jvm to start up your talend open studio?

For your question 2, you can set JDK Compliance level in Studio Java Compiler preferences. 0683p000009LsbR.png

Best regards

Sabrina

 

Anonymous
Not applicable
Author

Thanks for reply.

 

Yes, I wan't to set specific jvm at the time of running the job from console. Ex, my job is running from Task Scheduler. And I want to use specific jvm. So is there any way to achieve this? like editing of batch file or passing any dos parameter in Tasks scheduler ?

 

Regarding setting compliance level, I am aware of the option of setting compliance level from studio. But my question is what exact difference it makes when we set the compliance level?

Anonymous
Not applicable
Author

Here is how you can set the versions of Java inside your bat file. It is important to note that the best Java version to use is the JRE that comes with a JDK. This is a weird requirement (and may actually not be essential anymore....but it was, so I always use it) Anyway, your bat file will start like this.....

 

%~d0
cd %~dp0
java -Xms256M -Xmx4096M -cp .;../lib/routines.jar..........etc

Edit it to point to your JDK's JRE, like this....

 

%~d0
cd %~dp0
"C:/Program Files/Java/jdk1.8.0_91/jre/bin/java" -Xms256M -Xmx4096M -cp .;../lib/routines.jar..........etc

Note, that I am pointing my my JRE there. You will have to tailor it to your machine's JDK's JRE location.

Anonymous
Not applicable
Author

Thanks a lot.

That's exactly what I wanted. 

Though in my case it works with jre as well as jdk 0683p000009MACn.png