<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>This is more about deploying the Nashorn standalone module in the
context of Apache Tomcat 10 ("jakarta"-namespace) not about
creating a stand-alone Java application.</p>
<p>---rony<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 03.10.2022 19:03, Remi Forax wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1488686092.17982238.1664816612018.JavaMail.zimbra@u-pem.fr">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div style="font-family: arial, helvetica, sans-serif; font-size:
12pt; color: #000000">
<div><br>
</div>
<div><br>
</div>
<hr id="zwchr" data-marker="__DIVIDER__">
<div data-marker="__HEADERS__">
<blockquote style="border-left:2px solid
#1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From:
</b>"Simon Besenbäck" <a class="moz-txt-link-rfc2396E" href="mailto:simon.besenbaeck@gmail.com"><simon.besenbaeck@gmail.com></a><br>
<b>To: </b><a class="moz-txt-link-abbreviated" href="mailto:nashorn-dev@openjdk.org">nashorn-dev@openjdk.org</a><br>
<b>Sent: </b>Monday, October 3, 2022 3:04:26 PM<br>
<b>Subject: </b>Using Nashorn in Apache Tomcat<br>
</blockquote>
</div>
<div data-marker="__QUOTED_TEXT__">
<blockquote style="border-left:2px solid
#1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
<div dir="auto"><span style="font-size:12.8px">Hi!</span>
<div dir="auto" style="font-size:12.8px"><br>
<div>I am using Apache 10.0.23 on Windows 10. I want to
use Nashorn for developing JSP's within the Eclipse
IDE. Therefore I use OpenJDK 19 and added the
jakarta.ScriptTagLibs.jar to the lib directory. I
added script-jsr223.tld to the META-INF Folder. As far
as I know I should be able to use nashorn if I add the
nashorn-core-15.4.jar (downloaded here: <a
href="https://search.maven.org/artifact/org.openjdk.nashorn/nashorn-core/15.4/jar"
style="text-decoration-line:none;color:rgb(66,133,244)" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">https://search.maven.org/artifact/org.openjdk.nashorn/nashorn-core/15.4/jar</a>)
to the lib directory, but for me it doesn´t work. I
either get the Page without the elements generated by
nashorn or I get an Internal Server Error. </div>
<br>
<div>However, I also tried Rhino, by adding
rhino-engine-1.7.14.jar and rhino-runtime-1.7.14.jar
to the lib directory and it works. Though, if I try it
by only adding the rhino-1.7.14.jar to the lib
directory it won't work either. (Downloaded here: <a
href="https://github.com/mozilla/rhino/releases/tag/Rhino1_7_14_Release"
style="text-decoration-line:none;color:rgb(66,133,244)" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/mozilla/rhino/releases/tag/Rhino1_7_14_Release</a>)</div>
<br>
<div>I would be very thankful for any tipps as I really
do not know how to get nashorn working.</div>
</div>
</div>
</blockquote>
<div><br data-mce-bogus="1">
</div>
<div>Usually, when you want to build a Java application with
some dependencies, the best is to use a build tool that will
download the dependencies for you *and* configure your IDE
for you.<br>
</div>
<div><br data-mce-bogus="1">
</div>
<div>For a small project like the one you describe, i believe
it's simpler to use Maven. Maven uses a pom.xml file that
describes the dependencies and some plugins, you have one
for tomcat by example.</div>
<div>There is an eclipse plugin called m2eclipse that
configure eclipse from the pom.xml (you have to activate an
option in the m2e plugin).<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>There are a lot of tutorial on the internet on how to use
Maven with Eclipse.<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>Once you have played a little with Maven, dependencies
should be a problem from the past and you should be able to
focus on what you want to do :)<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<blockquote style="border-left:2px solid
#1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
<div dir="auto">
<div dir="auto" style="font-size:12.8px"><br>
<div>Thanks.</div>
<div style="color:rgb(136,136,136)">
<div dir="auto"><br>
</div>
<div dir="auto">Simon</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>regards,<br data-mce-bogus="1">
</div>
<div>Rémi<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
</div>
</div>
</blockquote>
<pre class="moz-signature" cols="100">
</pre>
</body>
</html>