# How can I compile a java code inside of unreal?

**URL:** <https://forums.unrealengine.com/t/how-can-i-compile-a-java-code-inside-of-unreal/587679>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, question, Blueprint\
**Created:** [June 22, 2022, 12:14pm UTC](https://forums.unrealengine.com/t/how-can-i-compile-a-java-code-inside-of-unreal/587679 "2022-06-22T12:14:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PAULASTYA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/paulastya/32/266396_2.png) [@PAULASTYA](https://forums.unrealengine.com/u/PAULASTYA)\
**Post date:** [June 22, 2022, 12:14pm UTC](https://forums.unrealengine.com/t/how-can-i-compile-a-java-code-inside-of-unreal/587679/1 "2022-06-22T12:14:14Z")

</div>

I am trying to make a java ide using Ue5.  
I have almost completed the project but I don’t know how to compile and run the java program.  
I know the cmd commands for this job but can I do this without using CMD as the game will hang during the compilation and the execution.  
\*I just install the new JDK “corretto-18.0.1” it does not require to use javac.  
going to the java bin directory  
then `java <then the file directory>`  
but I want to execute 3 commands in the same cmd How can I do it.

1. `cd/`  
2 . `cd <location of the jdk>`3. `java <then the file directory>`

---

<div class="post-metadata">

**Author:** ![PavanKalyan143](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PavanKalyan143](https://forums.unrealengine.com/u/PavanKalyan143)\
**Post date:** [September 26, 2025, 1:37pm UTC](https://forums.unrealengine.com/t/how-can-i-compile-a-java-code-inside-of-unreal/587679/2 "2025-09-26T13:37:39Z")

</div>

### Here’s how you can run multiple Java-related commands without hanging UE5 or relying too much on CMD:

Since CMD interrupts the game thread when called directly from UE5, your best bet is to use **asynchronous process management** with **`CreateProc`** in Unreal Engine (C++) or **System.Diagnostics.Process** if you’re bridging via .NET.

If you’re sticking with raw CMD calls temporarily, here’s how to chain those commands in _one line_:

```auto
cmd /c "cd C:\path\to\jdk\bin && java C:\path\to\YourFile.java"

```

Or if your `.java` file isn’t pre-compiled:

```auto
cmd /c "cd C:\path\to\jdk\bin && javac C:\path\to\YourFile.java && java YourFile"

```

Replace paths as needed.

To avoid freezing the UE5 game during execution:

- Use `AsyncTask` or `FRunnable` for background execution

- Capture stdout/stderr to a log file or in-game console

- Keep your JDK path environment variable clean to avoid `javac`/`java` mismatch

* * *

If you’re doing this as a learning project or for portfolio-building, you might like the [Java Full Stack Developer course at Visible Campus, Bangalore](https://visiblecampus.com/courses/java-full-stack-developer-bangalore) — they help you go beyond theory with real-world integration projects (Java + frontend + cloud dev). One of my batchmates actually built a Java-based code editor for learning modules!
