Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39503 > unrolled thread

Java Jython RDKit, some progress, still confused

Started byvjp2.at@at.BioStrategist.dot.dot.com
First post2020-06-16 15:54 +0000
Last post2020-09-15 22:41 -0700
Articles 20 on this page of 35 — 6 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-06-16 15:54 +0000
    Re: Java Jython RDKit, some progress, still confused Martin Gregorie <martin@mydomain.invalid> - 2020-06-16 19:54 +0000
      Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-07 12:40 +0000
        Re: Java Jython RDKit, some progress, still confused Martin Gregorie <martin@mydomain.invalid> - 2020-07-07 13:09 +0000
          Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-07 18:06 +0000
            Re: Java Jython RDKit, some progress, still confused Martin Gregorie <martin@mydomain.invalid> - 2020-07-07 19:23 +0000
              Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-07 20:11 +0000
                Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-08 11:32 +0000
                  Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-08 13:40 +0000
                    Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-08 15:30 +0000
                      Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-08 17:04 +0000
                        Re: Java Jython RDKit, some progress, still confused "C.D. Altenburg, Ph.D," <cdalten@gmail.com> - 2020-07-08 11:13 -0700
                          Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-08 18:33 +0000
                        Re: Java Jython RDKit, some progress, still confused Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-08 22:19 +0200
                      Re: Java Jython RDKit, some progress, still confused Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-08 22:23 +0200
                        Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-11 19:12 +0000
                          Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-12 17:24 +0000
                            Re: Java Jython RDKit, some progress, still confused Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-21 01:46 +0200
    Re: Java Jython RDKit, some progress, still confused Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-06-16 22:32 +0200
      Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-06-16 20:40 +0000
        Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-06-17 15:58 +0000
          Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-06-17 20:43 +0000
          Re: Java Jython RDKit, some progress, still confused Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-06-18 16:15 +0200
            Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-06-18 18:40 +0000
    Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-12 17:42 +0000
    Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-12 18:12 +0000
      Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-13 13:31 +0000
        Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-13 18:34 +0000
          Re: Java Jython RDKit, some progress, still confused Eric Sosman <esosman@comcast-dot-net.invalid> - 2020-07-13 16:13 -0400
            Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-16 16:29 +0000
            Re: Java Jython RDKit, some progress, still confused vjp2.at@at.BioStrategist.dot.dot.com - 2020-07-16 16:32 +0000
              Re: Java Jython RDKit, some progress, still confused "C.D. Altenburg, Ph.D," <cdalten@gmail.com> - 2020-07-17 08:42 -0700
              Re: Java Jython RDKit, some progress, still confused Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-21 01:53 +0200
                Re: Java Jython RDKit, some progress, still confused Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-07-21 01:55 +0200
    Re: Java Jython RDKit, some progress, still confused rahul kumar <lingmaaki@gmail.com> - 2020-09-15 22:41 -0700

Page 1 of 2  [1] 2  Next page →


#39503 — Java Jython RDKit, some progress, still confused

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-06-16 15:54 +0000
SubjectJava Jython RDKit, some progress, still confused
Message-ID<rcapvi$mnr$1@reader1.panix.com>
I found more CDs from 2015. It seems the .so and .dll files are redundant

I was able to get the thing to kinda start

But it seems the classpaths vs jars is confused

I couldn't >> pipe the error messages

I think I am so close but so far from the answer

I don't understand what the "jython ;" is about

PS, RDKit is suppsoed to be the chemistry what Macsyma is to math

Sorry for my bungling

@echo off
SET RD_HOME=.
SET JAVA_HOME=..\CommonFiles\JAVA\
SET JAVA_COMMAND=%JAVA_HOME%\bin\java.exe

SET LOCAL_CLASSPATH="%LOCAL_CLASSPATH%"; "%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\org.RDKit.jar; "%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\org.RDKitDoc.jar

"%JAVA_COMMAND%"  -classpath "%LOCAL_CLASSPATH%"  "%JAVA_HOME%"\bin\jython-standalone-2.5.jar  ;  jython -Djava.library.path="%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\  

rem unable to pipe error message but it says "could not find the main class"  in the RDKit jar
rem why are jars in the classpath and not .class?
rem putting -jar in front of jython .jar doesn't help, neither swapping cp and jar order
rem java.library.path points to dlls so what is lib..so?
rem I initially had the dlls then somewhere it said I needed the .so
rem -D is a java command so what is the jython statement about when jy..jar calls jython fine?
pause

rem error messgaes show forward slashes, even instead of dots   - why?

rem ?<? "%RD_HOME%"\rdkini.py  how pipe ini file - pipe or not, it terminates jython on end
 
:END

rem these are in rdkini.py
rem from org.RDKit import *
rem from java import lang
rem lang.System.loadLibrary('GraphMolWrap')
rem m = RWMol.MolFromSmiles('c1ccccc1')
rem m.getNumAtoms()



				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [next] | [standalone]


#39504

FromMartin Gregorie <martin@mydomain.invalid>
Date2020-06-16 19:54 +0000
Message-ID<rcb824$evu$1@dont-email.me>
In reply to#39503
On Tue, 16 Jun 2020 15:54:26 +0000, vjp2.at wrote:

> PS, RDKit is suppsoed to be the chemistry what Macsyma is to math
>

Have you been here yet? https://www.jython.org/

If not, its probably a good idea to do so and ask for help from blogs 
covering Jython and Python.
 

-- 
Martin    | martin at
Gregorie  | gregorie dot org

[toc] | [prev] | [next] | [standalone]


#39539

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-07 12:40 +0000
Message-ID<re1qf5$nam$1@reader1.panix.com>
In reply to#39504
*+-Have you been here yet? https://www.jython.org/

I read that my error messages are typically caused by classes not present at
run time that were present at complie time. Well, my Jython is from 2/12/2015
but the jar and dll are from 5/11/2014. So I may actually have the reverse
problem, too NEW a jython..??



				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39540

FromMartin Gregorie <martin@mydomain.invalid>
Date2020-07-07 13:09 +0000
Message-ID<re1s6h$g96$1@dont-email.me>
In reply to#39539
On Tue, 07 Jul 2020 12:40:06 +0000, vjp2.at wrote:

> *+-Have you been here yet? https://www.jython.org/
> 
> I read that my error messages are typically caused by classes not
> present at run time that were present at complie time. Well, my Jython
> is from 2/12/2015 but the jar and dll are from 5/11/2014. So I may
> actually have the reverse problem, too NEW a jython..??
>
What VERSIONS are these? Thats generally more useful information that 
when the jarfiles were built.

If I was in your position, I'd make sure that my JRE is a current long 
term support version, i.e. either Java 8 or Java 11, download Jython 
2.7.2 and take it from there. At least then any missing classes you 
download should be compatible with a current JVM, and at worst you should 
be able to get source from any missing Java classes and compile that.

Current JVMs and compilers will run surprisingly old JAR files and 
compile equally old source files, so anything yo download will probably 
recompile without error - I have Java source files that are older than 
yours and that still compile without errors.


-- 
Martin    | martin at
Gregorie  | gregorie dot org

[toc] | [prev] | [next] | [standalone]


#39541

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-07 18:06 +0000
Message-ID<re2dij$5l1$1@reader1.panix.com>
In reply to#39540
*+-> actually have the reverse problem, too NEW a jython..??
*+->
*+-What VERSIONS are these? Thats generally more useful information that 
*+-when the jarfiles were built.

*+-If I was in your position, I'd make sure that my JRE is a current long 
*+-term support version, i.e. either Java 8 or Java 11, download Jython 
*+-2.7.2 and take it from there. At least then any missing classes you 
*+-download should be compatible with a current JVM, and at worst you should 
*+-be able to get source from any missing Java classes and compile that.

I have JAVA on my system, but I am trying to run this with Portable Apps JAVA

Because I want to be able to carry this around.

But there is another issue, I need to find out if the 32bit v 64 bit dlls are
producing any conflicts. I am assuming the distinction does not apply to JAVA.



				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39542

FromMartin Gregorie <martin@mydomain.invalid>
Date2020-07-07 19:23 +0000
Message-ID<re2i48$sfr$1@dont-email.me>
In reply to#39541
On Tue, 07 Jul 2020 18:06:11 +0000, vjp2.at wrote:

> I have JAVA on my system, but I am trying to run this with Portable Apps
> JAVA
>
OK, but a quick search suggests that Portable Apps is little more than an 
installer for the Java JVM and JAR files - presumably the JAR files are 
those for the standard class library as well as third party support 
classes and applications. Apparently the JVM it installs is 32 bit by 
default. 

The Portable apps website is frustratingly silent on preferred Java 
versions, but if you have command-line access to the JVM and/or compiler, 
running  "java -v" will tell you the JVM version and whether its 32 or 64 
bit, for example:

$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

on a laptop running the 64 bit version of Fedora 31 Linux. JDK version 
1.8 is Java 8.

Thats info you DO need because jar files must NOT be a later version than 
the JVM, but should probably not be earlier than V 1.4

> But there is another issue, I need to find out if the 32bit v 64 bit
> dlls are producing any conflicts. I am assuming the distinction does not
> apply to JAVA.
>
That will depend on the hardware you're using. the hardware, JVM, JNI 
code and DLLs must *ALL* be either 32 bit or 64 bit.  

You probably also need either ant or maven if you're going to compile any 
Java source code just as you'll probably need a copy of 'make' if you're 
going to compile any C modules for the JNI interface to talk to.
 

-- 
Martin    | martin at
Gregorie  | gregorie dot org

[toc] | [prev] | [next] | [standalone]


#39543

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-07 20:11 +0000
Message-ID<re2ksp$aqk$1@reader1.panix.com>
In reply to#39542
THanks for the java -v. I just logged on to look it up.

I have four sets of files a few weeks apart from each other, but all four (2
dll, 2 jar) in each set are the same date. They are like a few bytes different
in size. But the 64:32 bit dlls are like 8:5 in size.

I'm going to take a break to think out a systematic way to swap each set of
files in and out for testing. Right now they are in zip files on my desktop.

I am reluctant to download any stuff right now. I don't have broadband (just
plain text dialup) during the pandemic and I don't feel comfortable with
virus checking.  I usually do stuff in the library and bring it home.  Which
is why I had all of these things on old CDs from five years ago.


				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39544

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-08 11:32 +0000
Message-ID<re4asg$jlv$1@reader1.panix.com>
In reply to#39543
Four sets of files, two different batch files (one with refs to the files,
another witht he files in the java command line).. no difference

Ok, another break to reflect..



				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39545

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-08 13:40 +0000
Message-ID<re4icd$t1t$1@reader1.panix.com>
In reply to#39544
YOu are not going to believe this (I don't) but this runs:

the -jar wasn't part of their instructions but they had : jython after the
jython jar, which I removed.

Now, I ran the initial statements and I got no complaints, but I also don't
have any clue if it actually works

from org.RDKit import *
from java import lang
lang.System.loadLibrary('GraphMolWrap')
m = RWMol.MolFromSmiles('c1ccccc1')
m.getNumAtoms()

Each line just returns the jython >>> prompt. But I'm relieved.
For now.
Many thanks to all.


@echo off
SET RD_HOME=.
SET JAVA_HOME=..\CommonFiles\JAVA
SET JAVA_COMMAND=%JAVA_HOME%\bin\java.exe
SET LOCAL_CLASSPATH=%RD_HOME%\rdkit-masterCode\JavaWrappers\gmwrapper\org.RDKit.jar

"%JAVA_COMMAND%" -Xmx256m -classpath "%LOCAL_CLASSPATH%" -jar "%JAVA_HOME%"\bin\jython-standalone-2.5.jar  -Djava.library.path="%RD_HOME%"\rdkit-masterCode\JavaWrappers\gmwrapper


:END




				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39546

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-08 15:30 +0000
Message-ID<re4opu$q3q$1@reader1.panix.com>
In reply to#39545
Too easy. It either meekly returns the prompt without doing anything.
Initially this happened withthe bat file.
I complied the bat file to exe.
Then the bat(!!!)  file says it doesn't know what RDKit is.
But the EXE file meekly returns the prompt, like the bat file orig did.
In both cases, you can run jython like print 3-4
So I'm not sure it loaded anything into Jython
But at least no complaints from Java


				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39547

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-08 17:04 +0000
Message-ID<re4uae$cp2$1@reader1.panix.com>
In reply to#39546
I found some gremlins like missing backslashes..but

jython standalone does not like

from java import lang

What gives?



				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39548

From"C.D. Altenburg, Ph.D," <cdalten@gmail.com>
Date2020-07-08 11:13 -0700
Message-ID<aa7052bf-5b68-43d2-9c7e-9748a746ba44o@googlegroups.com>
In reply to#39547
On Wednesday, July 8, 2020 at 10:04:25 AM UTC-7, vjp...@at.biostrategist.dot.dot.com wrote:
> I found some gremlins like missing backslashes..but
> 
> jython standalone does not like
> 
> from java import lang
> 
> What gives?
> 
> 
> 
> 				    - = -
> 	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
>   blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
>    facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
>   ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---

You're an idiot

[toc] | [prev] | [next] | [standalone]


#39549

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-08 18:33 +0000
Message-ID<re53h6$olq$1@reader1.panix.com>
In reply to#39548
In <aa7052bf-5b68-43d2-9c7e-9748a746ba44o@googlegroups.com> by C.D. Altenburg, Ph.D, <cdalten@gmail.com> on Wed, 08 Jul 2020 14:13:25 we perused:


*+-You're an idiot

Why, thank you kindly!

				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39550

FromDaniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Date2020-07-08 22:19 +0200
Message-ID<re59o1$b8v$1@dont-email.me>
In reply to#39547
On 2020-07-08 19:04, vjp2.at@at.BioStrategist.dot.dot.com wrote:
> I found some gremlins like missing backslashes..but
> 
> jython standalone does not like
> 
> from java import lang
> 
> What gives?

How do you know it doesn't like it? Be specific.

-- 
DF.

[toc] | [prev] | [next] | [standalone]


#39551

FromDaniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Date2020-07-08 22:23 +0200
Message-ID<re59vl$cs7$1@dont-email.me>
In reply to#39546
On 2020-07-08 17:30, vjp2.at@at.BioStrategist.dot.dot.com wrote:
> Too easy. It either meekly returns the prompt without doing anything.
> Initially this happened withthe bat file.
> I complied the bat file to exe.
> Then the bat(!!!)  file says it doesn't know what RDKit is.
> But the EXE file meekly returns the prompt, like the bat file orig did.
> In both cases, you can run jython like print 3-4
> So I'm not sure it loaded anything into Jython
> But at least no complaints from Java
> 

Mate, the Python script you showed doesn't seem to do anything either,
at least in terms of output. So your findings don't seem all that
surprising to me.

-- 
DF.

[toc] | [prev] | [next] | [standalone]


#39558

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-11 19:12 +0000
Message-ID<red2um$n1g$1@reader1.panix.com>
In reply to#39551
I think putting -jar in the original bat file got jython to load without any
of the RDkit or DLL libraries. I just got pure Jython.
And i was fooled all my problems went away! HA!

"%JAVA_COMMAND%" -Xmx256m -classpath "%LOCAL_CLASSPATH%" -jar "%JAVA_HOME%"\bin\jython-standalone-2.5.4-rc1.jar.jar   -Djava.library.path="%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\

ImportError: No module named RKDit

Because all the other ways of calling it produce no main class errors.
(Which seem to be that classes available at compile are not available at run)

I am starting to suspect "from java import lang" doesn't work on
Jython-standalone-2.5 (period) and needs the newer version.

"%JAVA_COMMAND%"  -jar "%JAVA_HOME%"\bin\jython-standalone-2.5.4-rc1.jar.jar

from java impoprt lang

ImportError: cannot import name lang

I am working on having somone mail me dowloads on CD.

BUT, this stuff was all packaged together. 
I run a lot of other Java packages fine.
Maybe the files got damaged.

				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39559

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-07-12 17:24 +0000
Message-ID<refh0v$p4$1@reader1.panix.com>
In reply to#39558

*+-"%JAVA_COMMAND%"  -jar "%JAVA_HOME%"\bin\jython-standalone-2.5.4-rc1.jar.jar

*+-from java impoprt lang

*+-ImportError: cannot import name lang

I ran
from java.lang import *
from java import lang
and it did not complain
but I have no idea what it did

Meanwhile, I poked in the jython web site and a number of batch files have
either a colon or semicolon after the classpath jar just before calling
jython

My initial batch file had a semicolon, but after jython.jar



				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


#39575

FromDaniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Date2020-07-21 01:46 +0200
Message-ID<rf5abs$rkv$1@dont-email.me>
In reply to#39559
On 2020-07-12 19:24, vjp2.at@at.BioStrategist.dot.dot.com wrote:
> *+-"%JAVA_COMMAND%"  -jar "%JAVA_HOME%"\bin\jython-standalone-2.5.4-rc1.jar.jar

Why ".jar.jar"? Star Wars reference?

> 
> *+-from java impoprt lang
> 
> *+-ImportError: cannot import name lang
> 
> I ran
> from java.lang import *
> from java import lang
> and it did not complain
> but I have no idea what it did
> 
> Meanwhile, I poked in the jython web site and a number of batch files have
> either a colon or semicolon after the classpath jar just before calling
> jython

Sure. Colon is a path separator on Unix. Semicolon is path separator on
Windows. Classpath expression is a path-separator-separated list of paths.

*But no spaces.*

> My initial batch file had a semicolon, but after jython.jar

I'm pretty sure that was a mistake.

-- 
DF.

[toc] | [prev] | [next] | [standalone]


#39505

FromDaniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Date2020-06-16 22:32 +0200
Message-ID<rcba82$339$1@dont-email.me>
In reply to#39503
On 2020-06-16 17:54, vjp2.at@at.BioStrategist.dot.dot.com wrote:
> I found more CDs from 2015. It seems the .so and .dll files are redundant
> 
> I was able to get the thing to kinda start
> 
> But it seems the classpaths vs jars is confused
> 
> I couldn't >> pipe the error messages
> 
> I think I am so close but so far from the answer
> 
> I don't understand what the "jython ;" is about
> 
> PS, RDKit is suppsoed to be the chemistry what Macsyma is to math
> 
> Sorry for my bungling
> 
> @echo off
> SET RD_HOME=.
> SET JAVA_HOME=..\CommonFiles\JAVA\
> SET JAVA_COMMAND=%JAVA_HOME%\bin\java.exe
> 
> SET LOCAL_CLASSPATH="%LOCAL_CLASSPATH%"; "%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\org.RDKit.jar; "%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\org.RDKitDoc.jar
> 
> "%JAVA_COMMAND%"  -classpath "%LOCAL_CLASSPATH%"  "%JAVA_HOME%"\bin\jython-standalone-2.5.jar  ;  jython -Djava.library.path="%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\  
> 
> rem unable to pipe error message but it says "could not find the main class"  in the RDKit jar
> rem why are jars in the classpath and not .class?
> rem putting -jar in front of jython .jar doesn't help, neither swapping cp and jar order
> rem java.library.path points to dlls so what is lib..so?
> rem I initially had the dlls then somewhere it said I needed the .so
> rem -D is a java command so what is the jython statement about when jy..jar calls jython fine?
> pause
> 
> rem error messgaes show forward slashes, even instead of dots   - why?
> 
> rem ?<? "%RD_HOME%"\rdkini.py  how pipe ini file - pipe or not, it terminates jython on end
>  
> :END
> 
> rem these are in rdkini.py
> rem from org.RDKit import *
> rem from java import lang
> rem lang.System.loadLibrary('GraphMolWrap')
> rem m = RWMol.MolFromSmiles('c1ccccc1')
> rem m.getNumAtoms()
> 

It's a bit tricky to tell for sure, as you are using an older version.
You should, if at all possible, heed Martin's advice and download an
up-to-date installer. It's 76MB, that shouldn't be the end of the world.

/That being said.../

I just downloaded the standalone jython JAR
(jython-standalone-2.7.2.jar) and gave it a spin.

Using a simple script:
> $ cat script.py
> def hello():
>     print ("Hello!")
> 
> if __name__ == '__main__':
>     hello()

I ran
> java -jar jython-standalone-2.7.2.jar script.py
which dutifully printed out:
> Hello!

Therefore, I would suggest what you do is this:

>> @echo off
>> SET RD_HOME=.
>> SET JAVA_HOME=..\CommonFiles\JAVA\
>> SET JAVA_COMMAND=%JAVA_HOME%\bin\java.exe
>> 
>> SET LOCAL_CLASSPATH="%LOCAL_CLASSPATH%";"%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\org.RDKit.jar;"%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\org.RDKitDoc.jar <-- removed the spaces
>> 
>> "%JAVA_COMMAND%"  -cp "%LOCAL_CLASSPATH%" -jar "%JAVA_HOME%"\bin\jython-standalone-2.5.jar -Djava.library.path="%RD_HOME%"\rdkit-master\Code\JavaWrappers\gmwrapper\ "%RD_HOME%"\rdkini.py 

Further, I still don't know what your problem with "terminate on end"
is. The command will execute the script. If the script should run
forever, then that's in the Python code that you should see to it.

I don't know what you mean by "prompt". If you're looking for the
interactive Python shell (which you'd get by running
jython-standalone.jar without a script), then a quick call to
> java -jar jython-standalone-2.7.2.jar --help
tells me that you need to add "-i" to your command line (after the -jar
XXX.jar)
> -i       : inspect interactively after running script; forces a prompt even
>            if stdin does not appear to be a terminal; also PYTHONINSPECT=x

HTH.

-- 
DF.

[toc] | [prev] | [next] | [standalone]


#39506

Fromvjp2.at@at.BioStrategist.dot.dot.com
Date2020-06-16 20:40 +0000
Message-ID<rcban4$qcf$1@reader1.panix.com>
In reply to#39505
Many thanks



				    - = -
	 Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus
  blog: panix.com/~vjp2/ruminatn.htm - = - web:  panix.com/~vjp2/vasos.htm
   facebook.com/vasjpan2 - linkedin.com/in/vasjpan02 -  biostrategist.com
  ---{Nothing herein constitutes advice.  Everything fully disclaimed.}---



[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web