1
我在Windows XP機器上安裝了JRuby 1.6.0。我也下載了Google gdata庫。此代碼:Windows中的JRuby和CLASSPATH
require "java"
$CLASSPATH << "D:\\javalib\\gdata\\java\\lib\\*"
include_class "com.google.gdata.client.docs"
給出了這樣的錯誤:
org/jruby/javasupport/JavaClass.java:1052:in `for_name': cannot load Java class
com.google.gdata.client.docs (NameError)
from org/jruby/javasupport/JavaUtilities.java:34:in `get_proxy_class'
from C:/jruby-1.6.0.RC1/lib/ruby/site_ruby/shared/builtin/javasupport/co
re_ext/object.rb:46:in `java_import'
from C:/jruby-1.6.0.RC1/lib/ruby/site_ruby/shared/builtin/javasupport/co
re_ext/object.rb:26:in `include_class'
from download_gdocs.rb:5:in `(root)'
的谷歌gdata的Java庫是D:\javalib\gdata\java\lib
。例如,如果我輸入jar tvf D:\javalib\gdata\java\lib\gdata-client-1.0.jar
我得到的(部分)如下:
0 Fri Feb 04 15:25:54 PST 2011 com/google/gdata/data/docs/
904 Fri Feb 04 15:25:54 PST 2011 com/google/gdata/client/docs/DocsService$Versions.class
6686 Fri Feb 04 15:25:54 PST 2011 com/google/gdata/client/docs/DocsService.class
這似乎解決了我的問題之一。我會在另一篇文章中發表我的其他問題。 – rlandster 2011-02-08 05:11:41