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

  • Home
  • SEARCH
  • 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 6194753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:21:00+00:00 2026-05-24T03:21:00+00:00

Here i am trying to load my Jruby script into my java code but

  • 0

Here i am trying to load my Jruby script into my java code but am getting long error that i realy don’t know what it means,

The player.rb file is in the same folder as the TEST.java is.

Here is the error am getting:

java.io.FileNotFoundException: .player.rb (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:117)
at org.jruby.embed.ScriptingContainer.parse(ScriptingContainer.java:1195)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1275)
at test.TEST.<init>(TEST.java:29)
at test.TEST.main(TEST.java:33)
Exception in thread "main" org.jruby.embed.ParseFailedException: java.io.FileNotFoundException: .player.rb (The system cannot find the file specified)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:143)
at org.jruby.embed.ScriptingContainer.parse(ScriptingContainer.java:1195)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1275)
at test.TEST.<init>(TEST.java:29)
at test.TEST.main(TEST.java:33)
Caused by: java.io.FileNotFoundException: .player.rb (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:117)
... 4 more

Java Result: 1

Here is my Java code:

import org.jruby.*; 
import java.util.ArrayList;
import java.util.List;
import org.jruby.embed.PathType;
import org.jruby.embed.ScriptingContainer;

public class TEST {
    private final static String jrubyhome = "C:/jruby-1.6.3";
    private final String filename = "player.rb";

    private TEST() {
        ScriptingContainer container = new ScriptingContainer();
        List<String> loadPaths = new ArrayList();
        loadPaths.add(jrubyhome);
        // JRuby 1.5.x
        container.setLoadPaths(loadPaths);
        // JRuby 1.4.0
        //container.getProvider().setLoadPaths(loadPaths);
        container.runScriptlet(PathType.ABSOLUTE, filename);
    }

    public static void main(String[] args) {
        new TEST();
    }
}

And here is my Ruby code:

def numberMethod
  number = 3
return number
end

puts numberMethod
puts "Test, test!"

The new error i got now:

java.io.FileNotFoundException: C:\Users\Oskar\Documents\NetBeansProjects\TEST\src\test (Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at java.io.FileInputStream.(FileInputStream.java:79)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:117)
at org.jruby.embed.ScriptingContainer.parse(ScriptingContainer.java:1195)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1275)
at test.TEST.(TEST.java:29)
at test.TEST.main(TEST.java:33)
Exception in thread “main” org.jruby.embed.ParseFailedException: java.io.FileNotFoundException: C:\Users\Oskar\Documents\NetBeansProjects\TEST\src\test (Access is denied)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:143)
at org.jruby.embed.ScriptingContainer.parse(ScriptingContainer.java:1195)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1275)
at test.TEST.(TEST.java:29)
at test.TEST.main(TEST.java:33)
Caused by: java.io.FileNotFoundException: C:\Users\Oskar\Documents\NetBeansProjects\TEST\src\test (Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at java.io.FileInputStream.(FileInputStream.java:79)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:117)
… 4 more
Java Result: 1

The new java code:

    import org.jruby.*; 
import java.util.ArrayList;
import java.util.List;
import org.jruby.embed.PathType;
import org.jruby.embed.ScriptingContainer;

public class TEST {
    private final static String jrubyhome = "C:/jruby-1.6.3";
    private final String filename = "C:/Users/Oskar/Documents/NetBeansProjects/TEST/src/test/player.rb";

    private TEST() {
        ScriptingContainer container = new ScriptingContainer();
        List<String> loadPaths = new ArrayList();
        loadPaths.add(jrubyhome);
        // JRuby 1.5.x
        container.setLoadPaths(loadPaths);
        // JRuby 1.4.0
        //container.getProvider().setLoadPaths(loadPaths);
        container.runScriptlet(PathType.RELATIVE, filename);
    }

    public static void main(String[] args) {
        new TEST();
    }
}
  • 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-24T03:21:00+00:00Added an answer on May 24, 2026 at 3:21 am

    I guess the PathType.ABSOLUTE constant is the culprit. Change that (e.g. to PathType.RELATIVE) or provide the full path to your test.rb file.

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

Sidebar

Related Questions

I'm getting an error here that says I haven't defined a method, but it
Programming Student here...trying to work on a project but I'm stuck. The project is
Here's the situation: I am trying to launch an application, but the location of
I'm actually trying load image based on its screen size. Code seems to be
I may be totally wrong here, I am trying to load an iframe as
I'm trying to load data from a CSV on my Windows PC into a
I'm trying to load WebBrowser content and after that I want to add some
Here's what I am trying to do: typedef enum { ONE, TWO, THREE }
Here's what I'm trying to do, and failing... I have a File model which
Here is what I am trying to do: Given a date, a day of

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.