Disable annoying output message [ Envjs/1.6 (Rhino; U; Windows 7 amd64 6.1; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13 ]

274 views
Skip to first unread message

Marcel Overdijk

unread,
Oct 12, 2011, 5:55:48 PM10/12/11
to mozilla-rhino
When running Rhino I always see this output message:

[ Envjs/1.6 (Rhino; U; Windows 7 amd64 6.1; en-US; rv:1.7.0.rc2)
Resig/20070309 PilotFish/1.2.13 ]

Can this be disabled

Marcel Overdijk

unread,
Oct 21, 2011, 5:58:28 AM10/21/11
to mozilla-rhino
Anyone?

Tim Schaub

unread,
Oct 25, 2011, 4:43:04 PM10/25/11
to mozill...@googlegroups.com
It looks like you got your js.jar by downloading Envjs - this is not
the standard message displayed before the Rhino shell prompt.

If you want to change yours, you can unarchive the js.jar and find the
Message.properties file in the org/mozilla/javascript/resources
directory. Edit this file and change the value of
implementation.version to whatever you'd like to have displayed. E.g.

implementation.version = My Very Own JavaScript Shell

Then re-archive the files, name the archive js.jar (or whatever yours
is currently called), and run Rhino again.

My Very Own JavaScript Shell
js>

The js.jar file (might be named js-1.6R5.jar or something) is a zip
format archive. You can extract and re-archive the files with any zip
utility.

Tim

PS - While you're at it, you should download an updated version of
Rhino (http://www.mozilla.org/rhino/download.html).

Marcel Overdijk

unread,
Oct 25, 2011, 4:50:29 PM10/25/11
to mozilla-rhino
Hi Tim,

Thanks for participating in this discussion. I'm now using the Rhino
jar from Maven.
And indeed the latest 1.7RC3. But this still gives this 'debug'
information.
I cannot change the file you mentioned and repackage as I have to
depend on official Maven artifact.

Marcel Overdijk

unread,
Nov 10, 2011, 4:52:12 PM11/10/11
to mozilla-rhino
bump

Andreas Bolka

unread,
Nov 10, 2011, 6:11:41 PM11/10/11
to mozilla-rhino
On Tue Oct 25 22:50:29 +0200 2011, Marcel Overdijk wrote:
> But this still gives this 'debug' information.

Why do you need this "disabled"? I.e. what is the use case where the
banner display is harmful/annoying?

If you run Rhino with a script (either from a file or passed via the
command-line) the banner isn't displayed anyway.

--
Regards,
Andreas

Marcel Overdijk

unread,
Nov 11, 2011, 5:12:14 AM11/11/11
to mozilla-rhino
Hi Andreas,

I'm using Rhino embedded in Java inside a Maven plugin.

When executing the maven plugin the 'annoying' message is displayed,
which I would like to avoid.
No it is not harmful, but also gives no benefit.

The maven plugin is outputtinf information which files it is process
like

> processing file a.less
[ Envjs/1.6 (Rhino; U; Windows 7 amd64 6.1; en-US; rv:1.7.0.rc2)
Resig/20070309 PilotFish/1.2.13 ]
> processing file b.less
> processing file c.less
> processing file d.less

But as above example between the maven log output the annoying message
is displayed.

Edy Hinzen

unread,
Mar 6, 2013, 6:30:45 AM3/6/13
to mozill...@googlegroups.com

Am Mittwoch, 12. Oktober 2011 23:55:48 UTC+2 schrieb Marcel Overdijk:
Can this be disabled


Hello together!

I'm using Marcel Overdijk's LessCss (https://github.com/marceloverdijk/lesscss-java) too, and I agree that the message is annoing whenever you run LessCss server side multiple (the message goes to system console and log).

Although this post is many months old, there seems no solution in this, except for eventually this ...

  • extract "env.rhino.js" from the library; create a copy in your own library
  • (I renamed that copy to "dvv-env.rhino.js")
  • Disable the line containing the call noted below (in my editor, it was line 13961) console.log('[ %s ]',window.navigator.userAgent);

Overload the class LessCompiler as shown below.

public class DvvLessCompiler extends LessCompiler
{
  public DvvLessCompiler()
  {
    try
    {
      final InputStream inputStream = getEnvJs().openConnection().getInputStream();
/*
  in this if-construct, I load the content of the inputStream and check for correct version.
  However, since I use several custom library calls, I ommit this
 
      if ( ... contains ( ..., "Envjs core-env.1.2.13")) // check for identical version
*/     
      {
        setEnvJs(DvvLessCompiler.class.getClassLoader().getResource("de/kivbf/cms7/javascript/dvv-env.rhino.js"));
      }
    }
    catch (IOException e)
    {
    }
  }
}

Kind regards and special thanks to Marcel Overdijk
Edy Hinzen

Edy Hinzen

unread,
Mar 6, 2013, 6:53:11 AM3/6/13
to mozill...@googlegroups.com
LOL ! ;-)
After hours and hours of internet researches, trial-and-error and finally "my own solution", I've found out, that Marcel meanwhile had solved the problem in lesscss 1.3.3  by overwriting the file env.rhino.js by himself ;-)

Reply all
Reply to author
Forward
0 new messages