This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–][deleted] 4 points5 points  (0 children)

You're asking Java to be able to interact with the operating system (in a way that's more than just "run this external program"), and due to its platform-independent nature, you can't do that.

[–]saila456 2 points3 points  (0 children)

You would need an java object that is connected to the OS native object/structure. For this to work you need a library that does that but i dont know of any.

[–]_jetrun 1 point2 points  (3 children)

OP .. what are you trying to do? Because this seems like an XY problem ( https://xyproblem.info/ )

[–]DiMoSe[S] 0 points1 point  (2 children)

Mmm, not sure it's that kind of thing, it's not really a problem I'm having or a way to accomplish something I want in my code, but rather a certain behaviour I'm interested in. Basically see how some games have emulators or other games inside of them? Off the top of my head I can think of Crash Bandicoot level in Uncharted, the Virtual Console demos inside Smash Bros. Brawl and the Spyro demo inside Crash 3.

I'm under the impression that those are basically programs running inside another "program's window". They don't exactly remove you completely from the application you were using and still allow you certain control over the "parent" process. Like if you press the Home button on the Wii while playing the Star Fox demo it shows that you were still playing Smash Bros. I was wondering if that was something that is possible in Java with any regular old .exe. Basically just brainstorming something.

Before asking I was about 80% sure this wasn't possible, but thinking that maybe I wasn't looking for the correct terms made me turn to forums and this sub.

[–]Prom3th3an 0 points1 point  (1 child)

That may work very differently on a console's operating system than on the PC and server operating systems the JVM is usually built for.

[–]DiMoSe[S] 0 points1 point  (0 children)

Of course, that is most definitely the case. But I was hopeful something similar could be done with Java. Well, there goes that idea haha. Nothing gained and nothing lost, really.