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 7525891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:40:47+00:00 2026-05-30T03:40:47+00:00

I was able to get all three running a Hello World in a Scala

  • 0

I was able to get all three running a Hello World in a “Scala Project” with a .java file as my main. The problem is that it is pulling from a “Java Project” I am not using, though I have the JRE System Library in my “Scala Project”. Here is the code as to what I am doing to help understand…

JRuby.java

import org.jruby.embed.ScriptingContainer;
public class JRuby {                                              

    public static void main(String[] args) 
    {                     
        System.out.println("Java, Scala and Ruby using the JRE.\n"); 

        ScriptingContainer container = new ScriptingContainer(); 
        container.runScriptlet("puts 'This is JRuby code in .java file!'");

        new ScallaHello().hello(); 

        System.out.println("This is standard Java Code in .java file!"); 
    }
}

ScallaHello.scala

class ScallaHello {

    def hello() { 
        println("This is a Scala Method in .scala file, object set in .java file")
    }

    System.out.println("This is Java Code in .scala file!")
    println("This is Scalla Code in .scala file!")
}

End results are…

Java, Scala and Ruby using the JRE.

This is JRuby code in .java file!
This is Java Code in .scala file!
This is Scalla Code in .scala file!
This is a Scala Method in .scala file, object set in .java file
This is standard Java Code in .java file!

I have the jars organized as the Scala Library, JRE Library and Referenced Libraries for the JRuby Jar. I also have the same in the “Java Project” that I don’t want to use. If I close that project, this project, “Scala Project” fails to run. Obviously this is not an important project, but I am wanting to better understand how this works.

  • 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-30T03:40:48+00:00Added an answer on May 30, 2026 at 3:40 am

    I ended up getting the issue corrected within the first week. This involved a dependency issue. I built a new project and it worked. This question was inactive for a while until om-nom-nom offered +50 for the answer. I am sorry if anyone felt there was still an answer needed. To make this answer resourceful to others, I have started a blog at http://shaneofalltrades.com/java.html with details on full set-up. Here is copy of that tutorial…

    If you already have Eclipse, you should be able to use that version, or follow these steps and install another Eclipse to keep this environment separate.

    1. Download Eclipse 3.7 Indigo from >>http://www.eclipse.org/downloads/ and choose the Eclipse IDE for Java Developers. Unzip in a folder easy for you to find. If not familiar with Eclipse, it does not automatically load into your program files. I placed mine in a documents folder. Once unzipped it is fully operational. You can pin the exceptional file to your task bar if easier for you.
    2. Download scala-2.9.1.final.zip file for Eclipse at >>http://www.scala-lang.org/downloads Follow instructions. At the time of this install, it involves pasting the download page/link into your Eclipse “Install New Software” section under the Help Tab in Eclipse.
    3. After pasting the link and naming your saved location, you should see the items…
      Make sure you expand these and see all boxes, select ‘Select All’ then select Next>, select Next> again to install. Accept terms and select Finish. Make sure you go through terms that need to select and see all windows for this are selected. I ran into an issue downloading until I went through the checkboxes and “Accept Terms” more thoroughly. Once everything installs properly it should restart or ask for a restart.
      Now Eclipse and Scala should be installed, but it still needs to be configured to work properly.
    4. After Eclipse restarts, it should ask you if you want to check if plug-in settings are correct, select yes.
    5. JDT Weaving should be enabled. Select recommended default settings and select OK.
    6. Now you should be able to select new project File>>New>Project… then select Scala Wizard>>Scala Project. Name your project then select next.

    Now we are going to take a break from Scala and download JRuby. This step can be skipped if you don’t want Ruby, or you can use this a the only step to just add JRuby to a Java project.

    Download JRuby

    1. Go to http://jruby.org/download and download JRuby 1.6.6 Complete .jar
    2. Place file in location you will remember as you will have to access it in Eclipse in a couple steps from now.
    3. Right click your Scala Package in the Package Explorer…
    4. Select Build Path, then select Add External Archives… Find your JRuby jar you just downloaded (placed in a safe folder before this step) and select it. Eclipse will load this to your project along with your other Libraries. There might be a better way to include this with the JRE System Library as well that would eliminate this step.

    Back to configuring your project in Eclipse…

    1. Right click Scala Package again in the Package Explorer and select Build Path then select Configure Build Path…. Go to Order and Export tab and check mark all Libraries, then select OK.
    2. Time To Build your project: Right Click Scala Package>>New>>Other…
    3. Java>>Class, Select Next
    4. Name it JRuby and check the boxes as this and select Finish…
    5. Next create a Scala Class: Right Click Scala Package>>New>>Scala Class
    6. Name it ScallaHello, select Finish.
    7. Paste in the code above and run!
    8. If it asks you if you want to configure Classpaths, select Yes.

    That should cover everything for your Hello World of Java, Scala and Ruby. If you have any issues, please ask and I will be happy to help.

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

Sidebar

Related Questions

Has anyone been able to get an NHibernate-based project up and running on a
I would like to be able to get a list of all possible files
Has anyone been able to get a variable record length text file (CSV) into
trying to get my first windows form running with controls. I havent been able
I have recently started work on a project that has already been running for
I need to be able get a single specific attribute from an element with
Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default
I'm able to get cells to format as Dates, but I've been unable to
I am not able to get my jwysiwyg and Jhtmlarea text editors to work
I am able to get the feed from the spreadsheet and worksheet ID. I

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.