@@ -67,7 +67,7 @@ audience_identifier: jvm
6767 <button type="button" class="compatibility_page-item" data-target="jvm-get-started-without-python-dependencies-maven" role="tab" aria-label="Maven" title="Maven" aria-selected="false" aria-controls="jvm-get-started-without-python-dependencies-maven" tabindex="-1" id="jvm-get-started-tab-without-python-dependencies-maven">
6868 <img src='{{ "/assets/img/logos/maven-logo.svg" | relative_url }}' alt="" aria-hidden="true" class="get-started-tabs__tab-logo">
6969 </button>
70- <button type="button" class="compatibility_page-item compatibility_page-active" data-target="jvm-get-started-without-python-dependencies-gradle-java" role="tab" aria-label="Gradle + Java " title="Gradle + Java " aria-selected="true" aria-controls="jvm-get-started-without-python-dependencies-gradle-java" tabindex="0" id="jvm-get-started-tab-without-python-dependencies-gradle-java">
70+ <button type="button" class="compatibility_page-item compatibility_page-active" data-target="jvm-get-started-without-python-dependencies-gradle-java" role="tab" aria-label="Gradle" title="Gradle" aria-selected="true" aria-controls="jvm-get-started-without-python-dependencies-gradle-java" tabindex="0" id="jvm-get-started-tab-without-python-dependencies-gradle-java">
7171 <img src='{{ "/assets/img/logos/gradle-logo.svg" | relative_url }}' alt="" aria-hidden="true" class="get-started-tabs__tab-logo get-started-tabs__tab-logo--gradle">
7272 </button>
7373 </div>
@@ -93,9 +93,23 @@ audience_identifier: jvm
9393 <div class =" snippet-badge " role =" img " aria-label =" Maven snippet " >
9494 <img src =' {{ "/assets/img/logos/maven-logo.svg" | relative_url }} ' alt =" " aria-hidden =" true " class =" snippet-badge__logo " >
9595 </div >
96- </div >
97- </div >
98- </div >
96+ </div >
97+ </div >
98+ <div class =" languages__example-box " >
99+ <div class =" languages__snippet " >
100+ {%- highlight java -%}
101+ import org.graalvm.polyglot.Context;
102+
103+ try (Context context = Context.newBuilder().allowAllAccess(true).build()) {
104+ context.eval("python", "print('Hello from GraalPy!')");
105+ }
106+ {%- endhighlight -%}
107+ <div class =" snippet-badge " role =" img " aria-label =" Java snippet " >
108+ <img src =' {{ "/assets/img/logos/java-logo.svg" | relative_url }} ' alt =" " aria-hidden =" true " class =" snippet-badge__logo snippet-badge__logo--java " >
109+ </div >
110+ </div >
111+ </div >
112+ </div >
99113 <div class =" get-started-panel " id =" jvm-get-started-without-python-dependencies-gradle-java " role =" tabpanel " aria-labelledby =" jvm-get-started-tab-without-python-dependencies-gradle-java " >
100114 <div class =" languages__example-box " >
101115 <div class =" languages__snippet " >
@@ -135,7 +149,7 @@ try (Context context = Context.newBuilder().allowAllAccess(true).build()) {
135149 <button type =" button " class =" compatibility_page-item " data-target =" jvm-get-started-with-python-dependencies-maven " role =" tab " aria-label =" Maven " title =" Maven " aria-selected =" false " aria-controls =" jvm-get-started-with-python-dependencies-maven " tabindex =" -1 " id =" jvm-get-started-tab-with-python-dependencies-maven " >
136150 <img src =' {{ "/assets/img/logos/maven-logo.svg" | relative_url }} ' alt =" " aria-hidden =" true " class =" get-started-tabs__tab-logo " >
137151 </button >
138- <button type =" button " class =" compatibility_page-item compatibility_page-active " data-target =" jvm-get-started-with-python-dependencies-gradle-java " role =" tab " aria-label =" Gradle + Java " title =" Gradle + Java " aria-selected =" true " aria-controls =" jvm-get-started-with-python-dependencies-gradle-java " tabindex =" 0 " id =" jvm-get-started-tab-with-python-dependencies-gradle-java " >
152+ <button type =" button " class =" compatibility_page-item compatibility_page-active " data-target =" jvm-get-started-with-python-dependencies-gradle-java " role =" tab " aria-label =" Gradle " title =" Gradle " aria-selected =" true " aria-controls =" jvm-get-started-with-python-dependencies-gradle-java " tabindex =" 0 " id =" jvm-get-started-tab-with-python-dependencies-gradle-java " >
139153 <img src =' {{ "/assets/img/logos/gradle-logo.svg" | relative_url }} ' alt =" " aria-hidden =" true " class =" get-started-tabs__tab-logo get-started-tabs__tab-logo--gradle " >
140154 </button >
141155 </div >
@@ -176,9 +190,28 @@ try (Context context = Context.newBuilder().allowAllAccess(true).build()) {
176190 <div class =" snippet-badge " role =" img " aria-label =" Maven snippet " >
177191 <img src =' {{ "/assets/img/logos/maven-logo.svg" | relative_url }} ' alt =" " aria-hidden =" true " class =" snippet-badge__logo " >
178192 </div >
179- </div >
180- </div >
181- </div >
193+ </div >
194+ </div >
195+ <div class =" languages__example-box " >
196+ <div class =" languages__snippet " >
197+ {%- highlight java -%}
198+ import org.graalvm.polyglot.Context;
199+ import org.graalvm.python.embedding.GraalPyResources;
200+
201+ try (Context context = GraalPyResources.contextBuilder().build()) {
202+ context.eval("python", """
203+ from pyfiglet import Figlet
204+ f = Figlet(font='slant')
205+ print(f.renderText('Hello from GraalPy!'))
206+ """);
207+ }
208+ {%- endhighlight -%}
209+ <div class =" snippet-badge " role =" img " aria-label =" Java snippet " >
210+ <img src =' {{ "/assets/img/logos/java-logo.svg" | relative_url }} ' alt =" " aria-hidden =" true " class =" snippet-badge__logo snippet-badge__logo--java " >
211+ </div >
212+ </div >
213+ </div >
214+ </div >
182215 <div class =" get-started-panel " id =" jvm-get-started-with-python-dependencies-gradle-java " role =" tabpanel " aria-labelledby =" jvm-get-started-tab-with-python-dependencies-gradle-java " >
183216 <div class =" languages__example-box " >
184217 <div class =" languages__snippet " >
0 commit comments