Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Java compatible problems with jython

 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey,

i wrote an ant task, which i want to include. but there are problems with java, which cannot find the methods i set.

following jython-script HibernateTask.py:


method is execute is not recognized by java clients. following line does not compile, it accepts instantiation of HibernateTask but gives name resolved error with call to execute:


my compiling commands:
$ jython.c bat -a -d -c -j task.jar HibernateTask.py
$ javac -classpath 'task.jar;.' Main.java

i am using jython 2.1 on java 1.4.2_12

another question: the last release of jython is mid 2005, has its development been stopped?

thnx a lot!
[ June 06, 2006: Message edited by: manuel aldana ]
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry it took me so long to respond to this question. You need to subclass a Java class or interface.

Read this article: http://wiki.python.org/jython/JythonMonthly/Articles/July2006/1

- Josh
 
manuel aldana
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


import org.apache....

class HibernateTask(Task):

def execute(self):
"@sig public void execute()"
print "task started"



i am subclassing Task (from ant), therefore i am indirectly subclassing Object. so that should not be the problem.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by manuel aldana:
another question: the last release of jython is mid 2005, has its development been stopped?


It's development has been lacking in visible progress but it hasn't stopped. You can follow the events through the jython-dev list, for example.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic