BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Aditi24
Obsidian | Level 7

Hi,

 

I want to call a java class, which resides in a jar file, through SAS. Also while calling to the java class I want to provide runtime parameters.

Please let me know how this could be achieved.

I am referring below code to call java program but not sure where to provide jar file location.

data _null_;
 * -- set length of variable to capture message ;
 length message $ 200 ;
 * -- initiate java object ;
 declare javaobj jobj ("helloWorld");
 * -- get message and clean up ;
 jobj.callStringMethod('getMessage', message);
 jobj.delete();
 put message = ;
run; 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jklaverstijn
Rhodochrosite | Level 12

You can add the location to the classpath in the jreoptions in the sas config file:

 

-jreoptions (-Djava.class.path= "c:\my java\classes\myclasses.jar";c:\java2\classes2\classes2.jar -oss600k)

Regards,

- Jan.

View solution in original post

1 REPLY 1
jklaverstijn
Rhodochrosite | Level 12

You can add the location to the classpath in the jreoptions in the sas config file:

 

-jreoptions (-Djava.class.path= "c:\my java\classes\myclasses.jar";c:\java2\classes2\classes2.jar -oss600k)

Regards,

- Jan.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1837 views
  • 0 likes
  • 2 in conversation