I get a black command RUN box to appear but it doesn't accept anything I type then it disappears.
I know from C++ when you get that box it blinks out unless you add a line
system ("pause") ;
but what do I know.
I'll start with this one.
What's happening is that you've apparently fashioned a text mode application (like a C++ console app, only in Java instead). There's no GUI. That's fine, but here's where your problem is. A text mode application runs in a command window (some still call that a DOS window). It's a commad line OS prompt for executing text only (console) applications. There's no problem with that, but if you execute such an application from within Windows, like double clicking an EXE that's a console application, the console opens, the application runs, then finishes, then the console window closes.
The "pause" solution is simply a way to hold the last step...keeping the window open so you can see what it may have written as text before the window closes.
A better solution, in my view, is to execute such commands by first opening a command window, which stays. Then, navigate as required and execute the console application by typeing it's name. It will execute, finish, and then...return to the command prompt instead of closing the window.
As to a few other points:
It's much easier to learn Java. C++ is my favorite and primary language of choice, but it's nasty. It's full of all kinds of pitfalls only experienced programmers can deal with. It's the choice for high performance application development. It is not a good choice for learning without a full out commitment to learning the language. Java avoids most of the pitfalls and complications.
The difference is that C++ is built on C, which was originally intended as a kind of CPU independent assembler with higher level features. It can be among the most efficient language choices you can make, but you're exposed to much of the "RAW machine like" behavior of the CPU. Java has no such aim. It uses a related syntax of course, but is intended for application development and ease of teaching / learning. C's first purpose was to write an operating system.
That said, you're still going to face similar application level learning, like that of the command line application paradigm mentioned earlier.
Java isn't intended for Linux. Your statement might apply to a version of Java intended for installation on Linux vs Windows, but I assure you the installers keep that from getting mixed up. Java is intended to be OS independent. There is considerable debate about application independence of platform or CPU, especially given the native interfaces (for OS and CPU) available.
It's clear you're just starting out, and my advise is to be patient. Proceed knowing you'll be confused for a while, but that subsides. There is a certain minimum amount of overall knowledge you must accumulate before you'll find yourself understanding these puzzles, and you're going to be bumping into walls like this for quite a while. Let that be the norm that it is. It fades eventually.
Like others have said, putting a Java app inside a web page is a defunct concept, but more to the point, it's also more work than learning Java. It's a hint that you're leaping too far into one direction (that of packaging an applet for the web) without having first learned the fundamentals. That's the reason for suggesting Java EE. What you need first is a general Java development environment.
Only after you have some experience with GUI applications in Java would it be appropriate to attempt putting such an application inside a web page.
The point being made about Java applets is in light of the fact that in modern browsers, Javascript has been used with sufficient results to obviate most needs for Java applets, as they once existed. Java applets offer more power, speed and flexibility, but at considerable cost to the user in time to install / setup Java, the security concerns of running a Java applet and the overall download density of doing that. It's only appropriate for highly ambitious web page targets where the power of Java is required to achieve the goal. That's rarely a good idea, its' been realized, because if the task is beyond Javascript, it's probably best as a standalone application rather than part of a web page. Exceptions exist but are rare.
The subject you're approaching has several parts. You need to focus on the language at this point. You've been caught up in another related subject entirely, that of installing or executing applications.
From within a debugger, if you execute a console application (text mode only), you're going to get a console window which will close when the application completes, just as you described.
However, running the application from the command prompt eliminates the debugger, so you can't follow the application from inside.
Two simple solutions exist. One, set a breakpoint at the start and the end of the application. That's the equivalent of a pause command as you mentioned before, but runs in the debugger.
Second, you can write the application so it waits at startup for some command or keystroke. Start it in the command window, then while it's waiting, use the debugger to "attach" to it.
You'll need to read about how such things are done. I've already gone on way too much, as patience limitations from other members have shown me.
If you're comfortable with your IDE, debugger and OS environment, there's little reason to reconsider it, so take the following lightly and skeptically.
Visual Studio on Windows installs and works with little effort. It functions as you'd expect, and documentation on "how to" write software using it usually works exactly as you expect.
What you've experienced this far is the more complicated challenge of setting up a Java development environment. Further, documentation and "how to" books have to be written with the assumption that students / users could be on Mac, Linux or Windows. This means much of the material relating to IDE configuration issues, behavioral quirks, OS specifics...are all left up to you, and are in separate texts or references.
The only problem is, Visual Studio doesn't really "do" Java. It's focused on C#, C++ and J# (the .NET languages).
Visual Studio and C# is so well documented by third parties, and functions in such
expected ways, that fewer surprises are in store for those who chose that path. I loathe C# myself, and it's certainly not Java. It does have a similar level of placement, as a language, but is more Windows centric (there is a Linux and MAC target option, but using it on those platforms is a lot like using Java in Windows...complicated). Certainly Java allows one to targate Android, while C# is highly limited in the mobile target space.
Both have a C++ related syntax, and both have benefits. C# is more native with Windows (very native, in fact)...Java is not.