don't click here

In Plain English - The Java JRE and Programs

Discussion in 'Technical Discussion' started by Travelsonic, Jun 6, 2012.

  1. Travelsonic

    Travelsonic

    Member
    821
    17
    18
    So my 'rents run a kitchen/bathroom refacing business, and give out disks with pdfs displaying vender catalogs, and a powerpoint presentation shocasing past work.

    I made a launcher that autoruns, and gives users a choice as to what they want to [launch the presentation, or view one of the various PDFs].

    Things is, I want to bundle the JRE so I don't have to worry about users not having Java installed. The problem? No matter how much googling I do, the results suck so far as choices that attempt to answer my question, or any result bearing answers is so monotonous to read through, overcomplicated, and just a pain in the ass.

    In plain English, if I wanted to bundle the JRE for users who may not have Java installed - the files for the program itself - including the PDFs, powerpoint, and the powerpoint viewer - take up no more than 28MB, so constraints on file size [so long as it fits on a CD-ROM] don't matter to me really, but right now I just care about ease of getting this finished. Been working on this for about 2 weeks [few hours every day, as my 'rents have me do other things around the office too + I like to go down to the railroad tracks and harass the engineers afterwards, but that's another story], and I just want to be fucking finished with it.
     
  2. HighFrictionZone

    HighFrictionZone

    Hi. Member
    855
    0
    16
    Katy, Texas
    Nothing
    Perhaps do ahead-of-time compiling directly into machine native code? I am told that GCJ (GNU Compiler for Java) has the option of compiling java directly to machine-native executable code, thereby sidestepping the need for the user to have Java! Even if GCJ doesn't work, there are other (usually more expensive) options for converting a Java program directly into an executable file that doesn't require the user to have Java installed. That seems like it would make more sense than trying to navigate the labyrinthine Oracle Java website for some sort of redistributable.
     
  3. Glitch

    Glitch

    Tech Member
    165
    3
    18
    Labyrinth? It's right here: http://www.oracle.com/technetwork/java/javase/downloads/jre-7u4-download-1591157.html

    It all depends on what you want to achieve. Assuming your launcher is some sort of AWT/Swing application, GCJ won't work. You won't be able to compile Java to native. You probably don't want to hear this but Java might not have been the best choice for an application that should autorun from CD (I say this as a Java developer).

    You'll have to resort to a batch file that detects whether java is installed (is JAVA_HOME set?) and conditionally launches either the installer or your application.
     
  4. Travelsonic

    Travelsonic

    Member
    821
    17
    18
    That actually sounds like a very easy solution.

    And I AM using Swing.
     
  5. SoullessSentinel

    SoullessSentinel

    Member
    257
    0
    16
    Grimsby, England
    Cxbx-Reloaded
    The guys over at PortableApps managed to compact the Java Runtime Environment to run entirely from a USB stick,with no installation, and also created a launcher that allows opening .JAR files in that environment. [jPortable] and [jPortable Launcher].
    I have no idea how well they would function on read-only media, such as a CD-ROM, but it might be worth looking into it and giving it a go.
     
  6. Travelsonic

    Travelsonic

    Member
    821
    17
    18
    Thanks for your help guys.



    Ugh, because of issues with the PDFs on Mac OS X systems, he decided to limit support to Windows PCs now - actually, I shouldn't preface that with an "ugh" - now I can redo the program in C#, and just have an autorun.inf on the CD, not having to worry about comparability with modern Windows PCs.
     
  7. Conan Kudo

    Conan Kudo

    「真実はいつも一つ!」工藤新一 Member
    478
    1
    18
    You could actually compile it down to native with IKVM and Mono, but if you rewrite it to C#, make sure it is Mono compatible. That way, you can use it on Windows, Mac OS X, and even Linux! However, only Windows and Linux support autoruns. Linux desktop environments will run "autorun.sh" and Windows reads "autorun.inf". Mac OS X dropped the feature without telling anyone, not that it was very useful as it only worked to load QuickTime presentations or movies.