Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
fxbonnet
Contributor

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.
Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

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

View solution in original post

10 Replies
Anonymous
Not applicable

Hi,
Are your studio and server(commandline, TAC) on different machine? Have you already installed jdk 1.8 on server?
Best regards
Sabrina
jvermaqb
Contributor

Hi...

 

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

Anonymous
Not applicable

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.

Anonymous
Not applicable

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

jvermaqb
Contributor

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

Anonymous
Not applicable

Hello,

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

Best regards

Sabrina

Anonymous
Not applicable

Hi Sabrina,

I have successfully used your advice with Talend ESB version 6.3.1

Best regards

Jan

Anonymous
Not applicable

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

Anonymous
Not applicable

Hi Sabrina, 

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

Cheers

Jan