# Export of an Java Sketch fails!

**URL:** <https://discourse.processing.org/t/export-of-an-java-sketch-fails/221>\
**Category:** Coding Questions\
**Created:** [May 21, 2018, 6:46pm UTC](https://discourse.processing.org/t/export-of-an-java-sketch-fails/221 "2018-05-21T18:46:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anongtr911](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anongtr911](https://discourse.processing.org/u/anongtr911)\
**Post date:** [May 21, 2018, 6:46pm UTC](https://discourse.processing.org/t/export-of-an-java-sketch-fails/221/1 "2018-05-21T18:46:38Z")

</div>

Dear Community!

I am about to create an simple hookah-designer in Processing.  
Its working on linux, but I would need it on Windows 10. And is there any simple way to get that .java/.jar file running on a web-page?  
Or do I really have to switch to JS? Because I’ve read something that JAVA and Html isn’t a clever combination.  
I can execute the programm with processing-java in the commandline. This is strange but it works… but I cant save it 😐  
I tried the java\_home and path varibales but no change!

Right now I am installing cygwin but that’s not the best solution…

My System:  
Win 10 Pro 64 bit  
JAVA JDK 1.8 and JRE 1.8  
Processing 3.3.7 (is it a Stable-Release?)  
8 GB RAM  
1 TB SSHD  
AMD Architecture( Hexa-Core FX-Series)

Would be really kind if someone could help me with that 😉

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [May 21, 2018, 6:50pm UTC](https://discourse.processing.org/t/export-of-an-java-sketch-fails/221/2 "2018-05-21T18:50:04Z")

</div>

See the discussion here:

> [@Displaying code on website](https://discourse.processing.org/t/displaying-code-on-website/208):
>
> Hi, Newbie question… Once you have some code you are happy with is it possible to add it to an HTML page? One site I use is coded in HTML and PHP?

Basically, you can’t embed a Java application in a website. You either have to use Processing.js or P5.js. This also means you can’t use Java-specific libraries.

You could export your sketch as an application and then allow users to download the application, but you can’t embed it directly in a webpage without using Processing.js or P5.js.

---

<div class="post-metadata">

**Author:** ![anongtr911](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anongtr911](https://discourse.processing.org/u/anongtr911)\
**Post date:** [May 21, 2018, 6:53pm UTC](https://discourse.processing.org/t/export-of-an-java-sketch-fails/221/3 "2018-05-21T18:53:16Z")

</div>

Ok, thank you really much for the fast answer!  
How much effort would it be to transpile the code from .java -\> .js?  
Is it worth it?

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [May 21, 2018, 6:59pm UTC](https://discourse.processing.org/t/export-of-an-java-sketch-fails/221/4 "2018-05-21T18:59:00Z")

</div>

It depends on whether you’ve used any Java-specific code. Many Processing sketches can be deployed using Processing.js, but if you’ve used Java-specific libraries then that won’t work.

Shameless self-promotion: here is a guide on deploying Processing using Processing.js:

> **[Processing.js](https://happycoding.io/tutorials/processing/processing-js)**
>
> Embed your sketch in a webpage.
