One Star

How to set java compiler source to 1.8?

Hi,
I wrote a routine that uses some java 1.8 features.
On my machine I just went to 'Windows/Preferences' and set the compiler compliance level to 1.8 and everything worked fine.
Now when I try to run the job on Talend Administrator center I get the following error:
Exception in thread "Thread-17" java.lang.Error: Unresolved compilation problems: 
     The method quote(String) in the type DatadogUtil is not applicable for the arguments (Object)
     Lambda expressions are allowed only at source level 1.8 or above
     ...

How do I tell Talend Administrator center to compile the project as java 1.8?
I also tried to change the source level by customising the project's pom.xml in the project settings but it did not work either.
1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: How to set java compiler source to 1.8?

Hello,

Do you have a user routine that uses Lambda expression new in Java 8?

Could you please make sure that all tac, command line, and jobserver are all running Java 8?

It looks like your commandline Java compliance was using 1.7. This needs to be set it to 1.8 for the three variables below:
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8

Could you please  follow these Steps to see if it works?
1) Stop commandline
2) Make the modification in the org.eclipse.jdt.core.prefs located in the Commandline/commandline-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
3) Restart Commandline
4) Log back in TAC: Regenerate, redeploy and run the task

We will appreciate it if you could give us some feedback.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
10 REPLIES
Moderator

Re: How to set java compiler source to 1.8?

Hi,
Are your studio and server(commandline, TAC) on different machine? Have you already installed jdk 1.8 on server?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: How to set java compiler source to 1.8?

Hi...

 

I am facing the same issue. How can we set the Talend Command line server to compile the job with JDK 1.8?

Seventeen Stars

Re: How to set java compiler source to 1.8?

Wen do not have any problems using Java 8 to compile jobs. Simple take care the command line application uses Java 8 and thats it.

Moderator

Re: How to set java compiler source to 1.8?

Hello,

Do you have a user routine that uses Lambda expression new in Java 8?

Could you please make sure that all tac, command line, and jobserver are all running Java 8?

It looks like your commandline Java compliance was using 1.7. This needs to be set it to 1.8 for the three variables below:
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8

Could you please  follow these Steps to see if it works?
1) Stop commandline
2) Make the modification in the org.eclipse.jdt.core.prefs located in the Commandline/commandline-workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
3) Restart Commandline
4) Log back in TAC: Regenerate, redeploy and run the task

We will appreciate it if you could give us some feedback.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: How to set java compiler source to 1.8?

Hi...

 

I tried the steps mentioned by you. This didn't solve the issue.

 

 My Talend job and custom routines jar is still being compiled with JDK 1.7

Moderator

Re: How to set java compiler source to 1.8?

Hello,

Could you please clarify in which Talend version/edition you are?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Seventeen Stars

Re: How to set java compiler source to 1.8?

Hi Sabrina,

I have successfully used your advice with Talend ESB version 6.3.1

Best regards

Jan

Moderator

Re: How to set java compiler source to 1.8?

Hello,

Would you mind creating a case on talend support portal so that we can give you a remote assistance, webex session through support cycle with priority?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Seventeen Stars

Re: How to set java compiler source to 1.8?

Hi Sabrina, 

why a support ticket, I have solved this already with the help of this thread.

Cheers

Jan

Moderator

Re: How to set java compiler source to 1.8?

Hello Jan,

Glad to see you here. It seems this solution doesn't work for user 'jvermaqb'. We would like to have a webex session with @jvermaqb to see if there is something missing.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.