0

I've been using the discontinued BuildDesk to compile and bundle my Java desktop application but it forces user to use legacy Java in macOS. I would like users to use latest as some users feel queazy about the word legacy.

I found a script to create an .app bundle. When I export the main jar from Netbeans (Run Target > Other Targets > package-for-store) and include the jar, libs and resources in the bundle, it runs OK but requires JDK to be installed, unlike the compiled app from BuildDesk.

Is there a way to bundle the jar so user doesn't need to download a JDK? I have found answers for Windows, not macOS. Some say no need for JDK, just JRE but I cannot get app to run if I have only JRE on my Mac.

Thanks.

Walrus
  • 3
  • 2
  • 1
    you only need a JDK to develop software. if it's just for running the software, either the JRE is sufficient, or there's a problem with your software – Stultuske Mar 30 '18 at 08:34
  • 1
    You will at lease JRE installed. – Prabhav Mar 30 '18 at 08:37
  • Thanks but apps run fine when compiled with BuildDesk, just not when output from Netbeans. – Walrus Mar 30 '18 at 09:25
  • I am not a developer but I know difference between JDK and JRE so not sure why my question is marked as duplicate, or answered as this seems to be a macOS issue and answers referred to creating Windows exes. – Walrus Mar 30 '18 at 09:29
  • @Walrus - While you say that, you know the difference between a JDK and a JRE, you are asking a question that signals that in fact you don't know the difference. The answer to your question is to install a JRE and run `java -jar yourApp.jar`. If that doesn't work, then you probably haven't made the JAR properly. And getting your users to install a JDK instead of a JRE probably won't help. Add more details of what you are trying and what actually happens. – Stephen C Mar 30 '18 at 09:43
  • @Stephen, I meant I know you need the JDK to develope, and JRE to run. When app is run, user sees message to install JDK. I didn't expect to see that message. I had removed legacy Java and ran app with latest Java. When I removed the JDK, I got same message as user to install JDK. In Windows, same jar with same libs and resources runs OK (no JDK on that machine).I was under impression if you saved jar using package-for-store in Netbeans, only libs, resources and a JRE are needed. – Walrus Mar 30 '18 at 12:10
  • Please add the details to the Question. Also please give **precise** details of the version of NetBeans that you are using. – Stephen C Mar 30 '18 at 13:16
  • This is the info about Netbeans and OS: Product Version: NetBeans IDE 8.2 (Build 201609300101) Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 2 Java: 1.8.0_161; Java HotSpot(TM) 64-Bit Server VM 25.161-b12 Runtime: Java(TM) SE Runtime Environment 1.8.0_161-b12 – Walrus Mar 30 '18 at 13:28
  • @Walrus - This is outside of my knowledge, so I personally can't help. But you are more likely to get help if you do what I suggested above. Put the details **into the question**. Most people will NOT bother to read a rambling comment stream to try to understand an unclear question. – Stephen C Mar 31 '18 at 00:55

1 Answers1

0

this is apparenlty because of a bug in mac and java : https://bugs.openjdk.java.net/browse/JDK-7131356

which leads java 1.6 (made by apple not oracle) to be required under any circustance of running a java app.

(even if the app is self-contained apparently)

tatsu
  • 2,316
  • 7
  • 43
  • 87