Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6814621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:42:38+00:00 2026-05-26T20:42:38+00:00

I’m going to write my own Python-Java interface. It is compiled as a DLL

  • 0

I’m going to write my own Python-Java interface. It is compiled as a DLL and
wrapped using ctypes.

Yet, it is possible to find Java-classes and allocate Java-objects.
But what would be an interface to another language without using those objects
methods? My aim is to make this as natural as possible. Unfortunately,
it isn’t just possible to find Java-methods only by name.

My model is the following:

JClass

  • An instance of this class represents a Java class.

JObject

  • An instance of this class represents a Java-object. It has to be
    initialized with a JClass-instance. (yet, of course, later there
    should be arguments for the constructor also.)

JMethod

  • Represents a method of a Java-object. It contains the name and signature of the desired method. The signature is evaluated dynamically by the classes that are given on initialization.

    Example:

    mainMethod  = JMethod('main', JStringArray)
    

    Note that JStringArray is an instance of JClass that represents a string-array.

    A JMethod can be added to a JClass instance. But can then be called only from an instantiated JObject.

JStaticMethod

  • Just like the JMethod, but it can also be called from a JClass
    instance.

Built-In types

  • I’m doing JInt, JShort, JLont, JChar, etc.. to be the
    built-in wrapper types.

    Like:

    JInt    = JClass('java/lang/Integer')
    JShort  = JClass('java/lang/Short')
    JString = JClass('java/lang/String')
    

Question(s):

  1. What do you think about this design?
  2. The JNI-Functions for calling methods of a Java-class / -object all
    take a variable amount of arguments. After reading several topics on
    calling a function with variable arguments from a function that does so,
    and also asked a question here on SO, I’m aware that this is not possible.
    Now, are there functions that don’t take a variable number of arguments
    but a va_list or something? I just need to find some way to call a method from Python in Java!
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:42:39+00:00Added an answer on May 26, 2026 at 8:42 pm

    1. What do I think of this design?

    • it’s not clear what actual problem you’re trying to solve.

    • what about edge cases; error-handling; forward-/backward-compatibility; bugs in Python/Java? Not fun, but essential for robust software.

    • mixing two languages is hard enough, mixing three is sure to be much much worse. I would expect major maintainability and coupling problems.

    • there are already solutions to these problems. RPC, for getting programs in different languages to talk to each other. Jython, for Java/Python interoperability. I believe, Jython even allows you to create Python objects in Java and vice versa directly. Clarifying any shortcomings of these existing systems, and how you would address these shortcomings, would be helpful.

    Here are a few missing things:

    • packages
    • privacy
    • interfaces/abstract classes
    • method resolution: overloads and overrides(especially when more than one method would match)
    • exceptions
    • type-checking, or recovering from type errors

    2. I just need to find some way to call a method from Python in Java! What about Jython, RPC, or just calling an executable?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a text area in my form which accepts all possible characters from
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.