In JDK6, is there a way to load multiple scripts, each in a file, and have the one script reference a method of another script? Sort of like ‘include’?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
I think you’re after the load() method/property of Rhino’s global object/scope
This will load a javascript source file, similar to how include/require will in PHP. Once you load a file, you’ll be able to call and function or use any object defined in the loaded file.
This is how things work when you’re using the Rhino shell, which is the only context I know (your question mentioned the Java SDK, which is outside my area of experience)