Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi. Does anyone know how to compile a string and get the output as a string?

I'm trying to make an programming mod for in-game java programming. An gui that acts as a "IDE":

image.thumb.png.c0aa9702fb17ec17d639c774c9a3c7e9.png

But I need to compile the code written by player. I have this string made by user in-game:

String code = "class JavaMod{ public static void main(String args[]){ System.out.println(\"Text\"); } }";

I need to compile the string, get the output in a "String output", (in this case the value should be "Text"), and show in-game GUI;

Of course for the player to play this mod will require JDK configured with bin path in control panel enviorment variables, because I need the actual Java Virtual Machine on player's PC for the code to be compiled, no?

 

 

Edited by MikeyJY

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.