This discussion is archived
3 Replies Latest reply: Nov 15, 2012 10:38 PM by Kayaman RSS

Distribute Java jar application in Optical Disk with private JRE

631145 Newbie
Currently Being Moderated
I am trying to ship my Jar application using DVDs and need the user just to run an exe and launch the program. So I have written a batch file which runs the jar using the private JRE shipped in the same DVD.

Now when I run the batch file from the DVD it takes over one minute to launch the application because JRE is in the DVD as well.

When I copy the JRE in hard disk and use that in my batch file to lauch the program it runs fast. However I wouldn't the path where the user copies the JRE in his hard disk. How would I detect the same in my batch file ?

Even Launch4J takes same time as batch file.

If I anyway have to ship JRE and ask the user install first ,how does batch file know the installed jre location if JAVA_HOME is not set. it would start using the jre in DVD and slow down. Anyway to make sure JAVA home is set to begin with ? May be 1st time if Java home is not set it copies to jre to C drive and then next time onwards it launches using the same Java home? What do you suggest

[cross post |http://stackoverflow.com/questions/13372969/distribute-java-jar-application-in-optical-disk]

Note I am using JDK8 , which is only developer preview now am I allowed to ship it in my DVD ?
  • 1. Re: Distribute Java jar application in Optical Disk with private JRE
    gimbal2 Guru
    Currently Being Moderated
    Neil Ghosh wrote:
    Note I am using JDK8 , which is only developer preview now am I allowed to ship it in my DVD ?
    I wouldn't do that. Even if it is allowed, which I doubt, you're shipping unfinished and potentially dangerous software. I would also stick to the runtime only if I were you.

    My answer to your main question is: yep, its a tough problem and you're not going to crack it without special measures. One such special measure is to generate an installer using one of the many installer generators you can find with Google.
  • 2. Re: Distribute Java jar application in Optical Disk with private JRE
    631145 Newbie
    Currently Being Moderated
    I wouldn't do that. Even if it is allowed, which I doubt, you're shipping unfinished and potentially dangerous software. I would also stick to the runtime only if I were you.
    I know, Sorry I meant shipping JRE only not JDK.
    My answer to your main question is: yep, its a tough problem and you're not going to crack it without special measures. One such special measure is to generate an installer using one of the many installer generators you can >find with Google.
    Yes I thought about installers but it would copy my jar and resource files to hard disk which I don't want to avoid piracy. Is there any way to access the rest of the files from DVD directly ?
    PS. My DVD vendor promisssed that he would burn them such a way that whole thing can't be copied to hard disk or imaged, I am yet to verify this.
  • 3. Re: Distribute Java jar application in Optical Disk with private JRE
    Kayaman Guru
    Currently Being Moderated
    Neil Ghosh wrote:
    Yes I thought about installers but it would copy my jar and resource files to hard disk which I don't want to avoid piracy.
    Distributing your program on a DVD is a bad idea if you want to avoid piracy.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points