Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
FreyInt
Contributor III
Contributor III

JSONObject cannot be resolved to a type

Hello,

I am trying to migrate a job that works. It uses JSON libraries.

When I build it I have the following error message :

org.talend.designer.runprocess.ProcessorException: Routines "FormatTransform" has compile errors

Error Line: 89

Detail Message: JSONObject cannot be resolved to a type

According to the posts I saw on this forum it seems linked to missing libraries, but unfortunately I don't see any missing .jars anymore and I copied some jar used from the current working version but it has no impact.

The code starts like this :

JSONObject root = new JSONObject();

JSONObject data = new JSONObject();

data.put("picture_id", row10.picture_id);

data.put("woa_id", row10.woa_id);

data.put("title", row10.woa_title);

data.put("path", row10.path);

I don't see how to find the missing libraries...

Any help would be highly appreciated

Thanks is advance

Labels (3)
5 Replies
Anonymous
Not applicable

Hello,

Could you please clarify in which Talend version/edition you are and what's JDK version you are using? Do you have more than 1 version of Java installed on your machine?

I met this issue before and it was due to availability of different java version in the system. If so, please try to remove old JDK if you are not using it anymore and

there may be chance to overcome this issue.

Best regards

Sabrina

gjeremy1617088143
Creator III
Creator III

Hi, to complete what @Xiaodi Shi​ says, you can go in the project settings select Build then Java Version and here you can choose the JDK version for your project

FreyInt
Contributor III
Contributor III
Author

@xdshi :

I have the old server : Talend 5.6 + Java 8 --> works

The New server : Talend 8 + Java 11 --> does not work (the build)

 

@gjeremy1617088143 :

I am not able to find the project settings like you say, but I launch Talend I specify the -vm the java 11 path

Anonymous
Not applicable

Hello,

Please have a look at this screenshot for detail.

0695b00000PKM2YAAX.pngBest regards

Sabrina

FreyInt
Contributor III
Contributor III
Author

Hello,

This is the value I have. Does it mean it uses java 8 ?

I have java11 too on the machine but it is not available here ...

 

0695b00000PKNprAAH.png