|
Re: Apache Batik: msg#00007lang.jruby.user
What you probably need to do is actually put the Batik jar files in the CLASSPATH variable, as in: set CLASSPATH=someJar1.jar;someJar2.jar .... etc or on a UNIX environment: export CLASSPATH=someJar1.jar:someJar2.jar ... etc Pointing the classpath at the base directory containing the .java files does not help because the files have not been compiled. The compiled files, with a .class extension, are required to execute the code. Those files are generally contained in the jar files, and so you need to point your CLASSPATH at the jar files directly. If you continue to have issues, please let us know. Sending your current CLASSPATH might also help. JRuby should be able to load classes and packages in your classpath sucessfully; it's just a matter of getting the classpath set right. - Charlie On 2/7/06, Mark Wong-VanHaren <markwvh@xxxxxxxxx> wrote: > Hi, folks- > > I am attempting to use JRuby to control Apache Batik. > (The Rasterizer, specifically.) > > I am utterly Java-ignorant. The problem I'm encountering > may well be very simple, just due to my complete Java ignorance. > Maybe someone more clueful can steer me right? > > The JRE (1.5.0_06) works fine; I can run the Batik-rasterizer JAR with it. > Also, JRuby (0.8.2) works fine; it successfully runs the JRuby sample scripts. > No problems there. > > What I'm ignorant about is how to do is to make JRuby recognize > Java classes/projects which are *not* part of the standard Java distro. > > My jruby script: > ====== > require 'java' > module Foo > include_package 'org.apache.batik.apps.rasterizer' > converter = Main.new # Main is a class in Rasterizer > end > ====== > > Running this (using bin/jruby.rb) produces the following error: > ===== > /home/enebo/release/jruby/src/builtin/javasupport.rb:409:in > `const_missing': uninitialized constant Main at Bobo (NameError) > from /home/enebo/release/jruby/src/builtin/javasupport.rb:409:in > `const_missing' > from svg_rasterizer.rb:4 > from :0 > ===== > > I presume that means that JRuby doesn't know where to find > "org.apache.batik.apps.rasterizer"? > > For rasterizer, I have both the JAR file and all the .java files. > > For the .java files, I set the environment variable CLASSPATH > to the dir just above "org", hoping that would help it find it, but no luck. > > For the .jar file, I've put it everywhere I could think of: in the > present working directory, in /usr/lib, and I-don't-remember-where-else, > with the same results. > > I would be greatly indebted to anyone who might point me > in the right direction. > > Thanks! > -Mark > mark wong-vanharen > markwvh at gmail dot com > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642 > _______________________________________________ > Jruby-user mailing list > Jruby-user@xxxxxxxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/jruby-user > -- Charles Oliver Nutter @ headius.blogspot.com JRuby Developer @ jruby.sourceforge.net Application Architect @ www.ventera.com ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Apache Batik: 00007, Mark Wong-VanHaren |
|---|---|
| Next by Date: | Re: Java, JRuby, and Eclipse: 00007, Thomas E Enebo |
| Previous by Thread: | Apache Batiki: 00007, Mark Wong-VanHaren |
| Next by Thread: | Re: Apache Batik: 00007, Thomas E Enebo |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |