Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 898185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:00:16+00:00 2026-05-15T15:00:16+00:00

I am on Ubuntu x64 bit running: java version 1.6.0_18 OpenJDK Runtime Environment (IcedTea6

  • 0

I am on Ubuntu x64 bit running:

java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

and

jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2010-02-11 6586) (OpenJDK 64-Bit Server VM 1.6.0_18) [amd64-java]

I have this code running on my Windows 7 computer at home. I recently copied over my whole folder over to Ubuntu, installed java, jruby, and associated gems but I get this error when I run my main file:

jruby run.rb test

=================Processing FREDERICKSBURG_1.1=======================
ERROR IN TESTING wrong element type class java.lang.String(array contains char)
/home/daryl/Desktop/work/Code/geografikos/lib/sentence_splitter/splitter.rb:21:in `to_java'
/home/daryl/Desktop/work/Code/geografikos/lib/sentence_splitter/splitter.rb:21:in `split'
/home/daryl/Desktop/work/Code/geografikos/lib/models/page.rb:103:in `sentences'
/home/daryl/Desktop/work/Code/geografikos/lib/extractor/lingpipe_svm.rb:34:in `extract'
/home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:9:in `process'
/home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:8:in `each'
/home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:8:in `process'
/home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:6:in `each'
/home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:6:in `process'
/home/daryl/Desktop/work/Code/geografikos/lib/statistics.rb:111:in `generate_all'
/home/daryl/Desktop/work/Code/geografikos/lib/statistics.rb:105:in `each'
/home/daryl/Desktop/work/Code/geografikos/lib/statistics.rb:105:in `generate_all'
run.rb:56

The focus of the error is:
ERROR IN TESTING wrong element type class java.lang.String(array contains char)

Everything works fine on my windows machine. I figured I was getting this error because I did not have JAVA_HOME set however I added this to bashrc as:

export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk

and have confirmed:

echo $JAVA_HOME
/usr/lib/jvm/java-1.6.0-openjdk

I can produce a similar error by removing my JAVA_HOME variable on windows:

=================Processing FREDERICKSBURG_1.3=======================
ERROR IN TESTING cannot convert instance of class org.jruby.RubyString to char
C:/work/Code/geografikos/lib/sentence_splitter/splitter.rb:21:in `to_java'
C:/work/Code/geografikos/lib/sentence_splitter/splitter.rb:21:in `split'
C:/work/Code/geografikos/lib/models/page.rb:103:in `sentences'
C:/work/Code/geografikos/lib/extractor/lingpipe_svm.rb:34:in `extract'
C:/work/Code/geografikos/lib/extractor/geo_controller.rb:9:in `process'
C:/work/Code/geografikos/lib/extractor/geo_controller.rb:8:in `each'
C:/work/Code/geografikos/lib/extractor/geo_controller.rb:8:in `process'
C:/work/Code/geografikos/lib/extractor/geo_controller.rb:6:in `each'
C:/work/Code/geografikos/lib/extractor/geo_controller.rb:6:in `process'
C:/work/Code/geografikos/lib/statistics.rb:111:in `generate_all'
C:/work/Code/geografikos/lib/statistics.rb:105:in `each'
C:/work/Code/geografikos/lib/statistics.rb:105:in `generate_all'
run.rb:56

It is obviously not exactly the same but I have a feeling this has to do with the java path. You can probably derive from the error that I am just trying to convert a ruby variable to java using to_java. This works fine on my windows machine and I have confirmed the gems are the same but I don’t think this has to do with gems.

I lied. I changed my JAVA_HOME back on my windows machine and this error still occurs. So now the code suddenly doesn’t run on either machine. I recently installed git on my windows machine and added the code to a repository. But I haven’t really done anything with it. All it said was it will convert all LF to CRLF…That shouldn’t change anything though should it? Any ideas on why I am now getting these errors? I haven’t changed anything on my windows machine in months except for installing git.

Update: What is going on is I cannot convert a ruby string to a java char, even if the ruby string is only 1 char long. This has never happened before and my java files have not been updated for over 2 months. I have not updated ruby either.

Here is the line of code associated with the error at this point:

tokenizer = IndoEuropeanTokenizerFactory.new.tokenizer(text.split('').to_java(:char), 0, text.length)

Where text is just a clean text paragraph being split into each character. A similar reproduction:

irb(main):002:0> ['1','2','3'].to_java :char
ArgumentError: wrong element type class java.lang.String(array contains char)
    from (irb):3:in `to_java'
    from (irb):3
irb(main):003:0> exit
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:00:17+00:00Added an answer on May 15, 2026 at 3:00 pm

    Converting a ruby string array to java array apparently isn’t supported with the to_java command in the latest version of jruby (1.5 I believe). If you use 1.3 it should work fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 483k
  • Answers 483k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think what you're trying to do is, at runtime,… May 16, 2026 at 7:04 am
  • Editorial Team
    Editorial Team added an answer In HTML, it doesn't matter at all. In PHP, it… May 16, 2026 at 7:04 am
  • Editorial Team
    Editorial Team added an answer Your main error I believe is that ovv0 is not… May 16, 2026 at 7:04 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.