Results 1 to 6 of 6
  1. #1
    gotenks05 is offline Member
    Join Date
    Sep 2008
    Posts
    34
    Rep Power
    0

    Default Does the JRE come with command to run?

    Hi, I know that I have not posted here for awhile, but I have a question something dealing with the JRE. I have created a program that only runs through the terminal/Command Prompt and while I know that is possible to turn it into a GUI application, I feel that there is no need to do so. I was wondering, does the JRE come with the "java" command or is it only the JDK? I have so far created a shellscript that runs on a Mac and a linux machine, but those had the ability to make Java programs. I was thinking of making an executable script for the Windows platform, that will execute the jar file for them.

  2. #2
    georgemc is offline Senior Member
    Join Date
    Sep 2008
    Posts
    135
    Rep Power
    0

    Default

    Yes, the JRE comes with a java executable

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default

    The JRE installation on Windows should set the command to be executed when a jar file is "opened": java -jar <jarfile>.
    The jar file should have a manifest file with the Main_Class: entry.

  4. #4
    gotenks05 is offline Member
    Join Date
    Sep 2008
    Posts
    34
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    The JRE installation on Windows should set the command to be executed when a jar file is "opened": java -jar <jarfile>.
    The jar file should have a manifest file with the Main_Class: entry.
    That only works if it is a Swing application, but I have not made a GUI version, so the user would need to manually type the command in or have a script (like a shell script for Mac/Linux or a Batch file for Windows).

  5. #5
    georgemc is offline Senior Member
    Join Date
    Sep 2008
    Posts
    135
    Rep Power
    0

    Default

    Quote Originally Posted by gotenks05 View Post
    That only works if it is a Swing application, but I have not made a GUI version, so the user would need to manually type the command in or have a script (like a shell script for Mac/Linux or a Batch file for Windows).
    What makes you think it only works for Swing apps? Not so. Granted, you'll have trouble shutting the thing down again, but it does work. A script is preferable, as you said

  6. #6
    gotenks05 is offline Member
    Join Date
    Sep 2008
    Posts
    34
    Rep Power
    0

    Default

    Quote Originally Posted by georgemc View Post
    What makes you think it only works for Swing apps? Not so. Granted, you'll have trouble shutting the thing down again, but it does work. A script is preferable, as you said
    He was talking about double clicking the jar file. I doubt command prompt will come up, but I could try it. It is just easier to have a script file that the user can double click on the icon. At least, it won't work like that on a Mac.

Similar Threads

  1. jsf command link
    By Srikala in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 06-25-2009, 08:03 AM
  2. Edit Command
    By viji83 in forum New To Java
    Replies: 1
    Last Post: 08-15-2008, 03:26 AM
  3. command
    By dirtycash in forum New To Java
    Replies: 8
    Last Post: 01-02-2008, 07:52 PM
  4. command help
    By dirtycash in forum New To Java
    Replies: 1
    Last Post: 12-05-2007, 12:24 AM
  5. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •