Graham
Graham

Reputation: 135

jpype and java.util.Properties

I'm attempting to instantiate a Properties object in JPype, and am encountering some difficulty. The commands below...

props = JClass('java.util.Properties')
props.setProperty('foo','bar')

...return the following:

RuntimeError: No matching overloads found. at src/native/common/jp_method.cpp:121

I've attempted various forms of the arguments, str('foo'), JString('foo'), java.lang.String('foo'), and nothing seems to work. Setting properties for other classes with this general approach in JPype works just fine (e.g., no problems with java.lang.System.setProperty('foo','bar')).

Any suggestions would be appreciated.

Upvotes: 1

Views: 2581

Answers (1)

Óscar López
Óscar López

Reputation: 236004

Try this:

Properties = JClass('java.util.Properties')
props = Properties()
props.setProperty('foo','bar')

Upvotes: 3

Related Questions