2

I am new to Jython. I downloaded a jar file from here http://www.jython.org/downloads.html

Download Jython 2.7beta1 - jython.jar Installer : Standalone version without the bundled python files.

When I run it:

$ java -jar jython-2.7-b1.jar Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52) [Java HotSpot(TM) 64-Bit Server VM (Apple Inc.)] on java1.6.0_33 >>> print "hello" ... 

I didn't get echoed string "hello", instead I got "...".

I guess the point here is what are the "bundled python files" those are missed from this jar.

8
  • You're supposed to run print 'text2print', not print('text2print'). Jython 2.7 is based on Python 2.7, not Python 3. Commented Jul 19, 2013 at 16:06
  • @kirbyfan64sos Thanks for pointing it out. I just tried the one without braces, but same issue happened. Commented Jul 19, 2013 at 16:54
  • What if you press enter at the ellipsis? Sounds like Jython is expected more. Commented Jul 19, 2013 at 17:38
  • @kirbyfan64sos I would keep getting more ellipsis. Commented Jul 19, 2013 at 18:02
  • Similar to this question: stackoverflow.com/q/13794278/407651 Commented Jul 19, 2013 at 18:16

1 Answer 1

4

The "bundled python files" are Python standard library modules (such as os.py) found in the Lib folder of a Jython installation.

When running Jython in standalone mode, everything -- including the bundled Python files -- is packaged in a single jar file. The current release for Jython 2.7 is jython-standalone-2.7-b1.jar. When using this jar file, I do not see the strange behaviour shown in the question. The simple print statement works:

$ java -jar jython-standalone-2.7-b1.jar Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52) [Java HotSpot(TM) Client VM (Oracle Corporation)] on java1.7.0_03 Type "help", "copyright", "credits" or "license" for more information. >>> print "hello" hello >>> 

The jython-2.7-b1.jar file is a variant of standalone Jython that does not include the bundled Python files. I don't know why anyone would want to use it. I haven't been able to find any documentation that explains why it is provided as a separate download at http://www.jython.org/downloads.html.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.