Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 6th, 2004, 03:32 AM
kdg kdg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 kdg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PythonInterpreter.initialize

Hello,

We're working on a project using Java and Python. While executing PyInterpreter.initialize() we encountered some problems.
The code we are using looks like this:

import java.util.*;
import org.python.util.*;
import org.python.core.*;

public class SimpleEmbedded {
public static void main(String []args) throws PyException {
PythonInterpreter interp;

Properties props=new Properties();
props.setProperty("python.path","/home/kdg/jython-2.1/Lib");
PythonInterpreter.initialize(System.getProperties(),props,args);
interp = new PythonInterpreter();
}
}

This code generates the following error-message:
Exception in thread "main" java.lang.NullPointerException
at org.python.core.PyJavaClass.lookup(PyJavaClass.java:43)
at org.python.core.PyObject.<init>(PyObject.java:46)
at org.python.core.PySingleton.<init>(PySingleton.java:8)
at org.python.core.PyNone.<init>(PyNone.java:10)
at org.python.core.PySystemState.initStaticFields(PySystemState.java:396)
at org.python.core.PySystemState.initialize(PySystemState.java:375)
at org.python.core.PySystemState.initialize(PySystemState.java:348)
at org.python.util.PythonInterpreter.initialize(PythonInterpreter.java:40)
at SimpleEmbedded.main(SimpleEmbedded.java:16)

Can anyone help us ?
Thanks,

Ann Carpentier
Kenny Mees

Reply With Quote
  #2  
Old February 6th, 2004, 05:46 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
by Java and Python do you mean Jython? You might have more luck in the Java forum with this one even if you are working with Pythons Core i dout many people here (me included) are qualifide to answer your question

If you like i can try moveing your thread for you?

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #3  
Old February 6th, 2004, 07:21 AM
kdg kdg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 kdg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
move message

Indeed, we do mean Jython.

Can you please move our thread to the appropriate location?

Thanks

Reply With Quote
  #4  
Old February 6th, 2004, 07:35 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Ok i've moves the tread to the Java forum, but there IS still a pointer to this thread in the Python forum so anyone who might be able to help can still see it!

Good luck with the project,

Mark.

Reply With Quote
  #5  
Old February 6th, 2004, 08:23 AM
kurious's Avatar
kurious kurious is offline
Prom night: 1973
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2001
Posts: 1,156 kurious User rank is Sergeant (500 - 2000 Reputation Level)kurious User rank is Sergeant (500 - 2000 Reputation Level)kurious User rank is Sergeant (500 - 2000 Reputation Level)kurious User rank is Sergeant (500 - 2000 Reputation Level)kurious User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 9 h 54 m 51 sec
Reputation Power: 23
I've never used Jython, but this post suggests you make sure jython.jar is included in your classpath.

Reply With Quote
  #6  
Old February 6th, 2004, 09:44 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,537 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Jython is an implementation of the Python programming language in pure Java... mmmm ok... not gonna mean anything to most of you since well you're into Java not python but..
Quote:
Sean McGrath, CTO, Propylon
Jython, lest you do not know of it, is the most compelling weapon the Java platform has for its survival into the 21st century:-)


Mark.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > PythonInterpreter.initialize

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap