On 9/11/2012 5:12 AM,
wrote:
> On NetBeans, how do I determine what JDK I'm using. I forgot which
> one I loaded.
It's in your project properties. And it's not the one you have loaded,
it's the one you have set for the build target. In other words, if you
are using JDK 7, you can still be targeting for example Java 5 in your
project, which is useful if you have users still on Java 5 who don't
want to upgrade.
Right-click on the project, Properties -> Sources, way down at the
bottom it says "Sources/Binary Format", that's your target (I'm using NB
7.2 btw, I seem to remember a slightly different option format in NB 6).
Also, you need the JRE. The JDK is for development, your users won't
normally need that. All they need is the normal runtime, the JRE. You
personally can use the JDK, because it contains a JRE, but anyone else
will normally just have the JRE.
To run, you use java -cp <path to all needed jars> -jar <path/your jar>
If you need to do fancier things than that (distribute over the
internet, for example) then look into Java WebStart or consider OneJar
if you are going to just copy the files around.