Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Installing java2python (Newbie)

122 views
Skip to first unread message
Message has been deleted

Jeremy Dillworth

unread,
Feb 27, 2007, 11:34:35 PM2/27/07
to
I haven't used that particular package, but the norm for setup.py is
this command line:

python setup.py install

Hope this helps,

Jeremy

Message has been deleted

Jeremy Dillworth

unread,
Feb 28, 2007, 12:14:55 AM2/28/07
to
You'll need to run the command in the command-line window. If you're
unfamiliar, here's how to start it up: Click "Start" then "Run..."
then type "Cmd" in the open field. Click OK.

Once you're at the command line there will be a little variation
depending on where things are located on your PC. If Python is
installed properly, you should be able to invoke the Python
interpreter from the command-line regardless of your current working
directory, so you don't need to unzip java2python under the Python 2.5
folder. You should do something like this:

cd \path\to\java2python\unzipped
python setup.py install

troy.m...@gmail.com

unread,
Feb 28, 2007, 12:27:56 AM2/28/07
to
> Hi Jeremy, that's the problem I'm having. Where should I type that "
> python setup.py install" ? Once again I'm using Windows system and not
> Unix. Should I move the file to a specific folder under Python 2.5 and
> then type " python setup.py install" in IDLE or Command Line window?
> I get the error "SyntaxError: invalid syntax" with the word "setup"

hi andy,

you want to run the windows command prompt, which is called "cmd.exe"
in windows xp. press the "start menu", then select "run", then type
"cmd.exe" without the quotes.

a window will pop up that looks black, and it will have a prompt like
"C:\" or "D:\something". with this window, you need to type several
commands. the first command is "cd", which changes the working
directory. you'll want to type the name of the drive and folder where
you extracted the j2py package. this can be anywhere, and it doesn't
have to be in your python folders. example:

C:\> cd D:\temp\java2python-0.2

next, you'll need to run the setup script with python. you can test
for python at the prompt like this:

D:\temp\java2python-0.2\> python -V

if you get "Python 2.5", you're ready to run the script. if you don't
get that, or if you get something along the lines of "command not
found", then you'll have to qualify the command with the full path to
the 2.5 interpreter. for example:

D:\temp\java2python-0.2\> C:\Python2.5\python.exe -V

i don't know where you installed python, nor do i remember much about
how the windows installation layout, so you'll have to figure out
these paths on your own.

once you get the "Python 2.5" response, you can install the package.
this is the easy part. use whatever command you got to reply "Python
2.5", enter it again, along with a space followed by "setup.py
install" (again, no quotes). continuing the example above:

D:\temp\java2python-0.2\> C:\Python2.5\python.exe setup.py install

you should read all of the output closely -- look for errors. you
might have problems installing the software if you're not an
administrator.

if you don't have problems, the setup process will have copied a
script named "j2py" somewhere in your system path. try "j2py --
version", and if everything works, you'll get the reply "j2py 0.2".
once the script is installed, change to the directory of your java
files (using "cd"), then do something like this, substituting your
file names where appropriate:

D:\myjavafiles\> j2py -i someclass.java -o someclass.py

best of luck to you, and please do let me (or the group) know how
everything works out.

Message has been deleted
Message has been deleted

Troy Melhase

unread,
Feb 28, 2007, 1:22:45 AM2/28/07
to lovel...@gmail.com, pytho...@python.org, tr...@gci.net
> properly now (error free!! yay) and the j2py script is located under :
> C:\Documents and Settings\Ujjal Pathak\Desktop\java2python-0.2\build
> \scripts-2.5

that doesn't look right -- it looks like you found what the setup
script left behind. what you should look for is j2py in either (a)
your python directories or (b) in your system directories. look in
c:\python2.5 first.

> Meaning under scripts-2.5 folder, there are two files j2py and
> jast_print but without any file extension though!

correct, they don't have extensions. once you find the real scripts,
rename them to include the .py extension. these scripts are meant to
run from a prompt, and double-clicking them in the windows file
manager won't do any good.

John Machin

unread,
Feb 28, 2007, 4:22:47 AM2/28/07
to
On Feb 28, 4:27 pm, "troy.melh...@gmail.com" <troy.melh...@gmail.com>
wrote:

> > Hi Jeremy, that's the problem I'm having. Where should I type that "
> > python setup.py install" ? Once again I'm using Windows system and not
> > Unix. Should I move the file to a specific folder under Python 2.5 and
> > then type " python setup.py install" in IDLE or Command Line window?
> > I get the error "SyntaxError: invalid syntax" with the word "setup"
>
> hi andy,
>
> you want to run the windows command prompt, which is called "cmd.exe"
> in windows xp. press the "start menu", then select "run", then type
> "cmd.exe" without the quotes.
>

Hi Troy, Windows users don't really "want" to do that. They'd prefer
to download a Windows installer, and "double-click on it".

http://docs.python.org/dist/postinstallation-script.html

This might save some wear'n'tear on their nervous systems, and
yours :-)

HTH,
John


Troy Melhase

unread,
Feb 28, 2007, 4:33:21 AM2/28/07
to John Machin, pytho...@python.org
> Hi Troy, Windows users don't really "want" to do that. They'd prefer
> to download a Windows installer, and "double-click on it".

Hi John,

Understood and agreed. I was thinking about Andy's problem, and I
realized that many users would benefit from a gui to do side-by-side
translation. If I ever have the time, I could write one I think.

> This might save some wear'n'tear on their nervous systems, and
> yours :-)

Like so many projects, it works for me the way it is -- I'm driving
j2py via makefiles, and a gui just isn't something I need. But of
course patches are welcome -- even gui ones!

John Machin

unread,
Feb 28, 2007, 5:12:33 AM2/28/07
to

Did you think I was suggesting that you write a GUI version of
java2python? Please carefully (re)?read the documentation link that I
gave you. The idea is that with a simple variation of your setup.py
build comamnd, you create a Windows installer for your existing
package, and make it available for download. Then, all the Windows
user has to do is to double-click on it, and it guides them through
the installation. This would save wear'n'tear on you having to try to
explain to some newbie Windows user how to install your package.

HTH take 2,
John

Troy Melhase

unread,
Feb 28, 2007, 5:39:34 AM2/28/07
to John Machin, pytho...@python.org
> Did you think I was suggesting that you write a GUI version of
> java2python? Please carefully (re)?read the documentation link that I
> gave you. The idea is that with a simple variation of your setup.py
> build comamnd, you create a Windows installer for your existing
> package, and make it available for download. Then, all the Windows
> user has to do is to double-click on it, and it guides them through
> the installation. This would save wear'n'tear on you having to try to
> explain to some newbie Windows user how to install your package.

You're right, and what I didn't communicate was the thought process
that was between "users need an installer" and "users need a gui". I
jumped to the end and only typed that. Sorry for any confusion.

John Machin

unread,
Feb 28, 2007, 5:50:53 AM2/28/07
to

I doubt that users need a GUI (but TMMV of course).

No need to say sorry -- I wasn't confused :-)
Cheers,
john

Message has been deleted

MRAB

unread,
Feb 28, 2007, 5:54:26 PM2/28/07
to
On Feb 28, 5:27 am, "troy.melh...@gmail.com" <troy.melh...@gmail.com>
wrote:

> > Hi Jeremy, that's the problem I'm having. Where should I type that "
> > python setup.py install" ? Once again I'm using Windows system and not
> > Unix. Should I move the file to a specific folder under Python 2.5 and
> > then type " python setup.py install" in IDLE or Command Line window?
> > I get the error "SyntaxError: invalid syntax" with the word "setup"
>
> hi andy,
>
> you want to run the windows command prompt, which is called "cmd.exe"
> in windows xp. press the "start menu", then select "run", then type
> "cmd.exe" without the quotes.
>
[snip]
FYI, a quicker way to the command prompt is Start->All Programs-
>Accessories->Command Prompt.

Gabriel Genellina

unread,
Feb 28, 2007, 9:05:17 PM2/28/07
to pytho...@python.org
En Wed, 28 Feb 2007 19:54:26 -0300, MRAB <goo...@mrabarnett.plus.com>
escribió:

> On Feb 28, 5:27 am, "troy.melh...@gmail.com" <troy.melh...@gmail.com>
> wrote:
>> you want to run the windows command prompt, which is called "cmd.exe"
>> in windows xp. press the "start menu", then select "run", then type
>> "cmd.exe" without the quotes.

> FYI, a quicker way to the command prompt is Start->All Programs-
>> Accessories->Command Prompt.

I dont like navigating deep menu structures... I prefer [WindowsKey]+R,
cmd, [Enter]

--
Gabriel Genellina

MRAB

unread,
Mar 1, 2007, 7:20:56 PM3/1/07
to
Well, if you use it a lot then you can pin it to the Start menu.


0 new messages