nubee question version problems running java app crom command line

Answered

Hi,

I am just makeing a hello world swing app... the tutorial one and can run it from the IDE OK.

However the command line ( windows 10 ) faults out and prints 10 or so lines of nasty errors saying my JRE is too old for the JDK I developed with.  I have the latest JRE.  I have the latest JDK.  I thought I would get an older JDK and try that.  But all links to old versions redirrect me to the latest.

Two questions:

1) I really dont know what to ask except how do I make this work?

2) Why such a caustic reaction from the command line?  I would not want users to see that when their JRE is not the latest.  Is there a try-catch that I can use to more gently let users know that due to their antiquity they are not entitled to use my app?

Maybe that is what Java is trying to tell me?

Thanks in frustration,
Tony

 

 

 

0
4 comments

Hi,

I am addding to this question...

I googled the problem and found a sollution on statk overflow.  My path was pointing to the JRE that I installed from Oricle.  The installer put it there.  However the sollutin presented wad to make the path point to the "bin" directory of the JDK.  I am using openJDK so I pointed it to that.  It worked.

My Question

1) How will regular users run my Hello world app?  They will not be able to install the JDK from Oricle... at least I couldnt without a liscense.  How would they know to do that anyway?  And will the figure out that they need openJDK.

2) I can run other java apps without the JDK.  I must be doing something stupid?

 

Thanks

 

 

0

It's not a question about IDE, but about development in general. That is why I recommend you to ask that on StackOverflow, or watch a learning course for Java Developers where it should be addressed. 

>  How will regular users run my Hello world app? 

There are 2 versions of Java: JRE(Java Runtime Environment) and JDK(Java Development Kit). JDK=JRE+tools for developers. 

Once you created your app via JDK (and compiled it via javac), you can distribute your app to other users. All these users should have JRE installed with the version not less than the version of JDK used to compile the app. 

So, if you want to develop for users with JRE 8, just use JDK 8 to develop the app. 

0

Thanks, that helps.  Maybe this is a stackoveflow question too but I'll ask anyway.  What is the sweet spot for revision to develop with.  I.E. latest features with largest user base?

Tony

0

Please sign in to leave a comment.