• Post Reply Bookmark Topic Watch Topic
  • New Topic

Command Line from a jar  RSS feed

 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have finished writing my program (on my Mac) and am about to make a .jar file out of it and transfer it to another computer which doesn't have a java compiler installed. According to what I've read, a .jar file should be able to be run by just about any computer. My program doesn't have any graphics; it's all command-line. How do I get it to run on this Windows 98 computer? Will a command prompt appear when I double click the .jar? Do I open the command prompt and type in "run foobar.jar" or something like that? I think I found the right command prompt. It is called "MSDOS prompt" and when you open it it says C:\WINDOWS>
Is that right?
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you are going to need a JRE on the client machine. If the bin directory of the JRE is in your path, then you could execute the jar with

java -jar jarfile
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is a JRE and how do I find out whether or not it's already on the computer, and if it's not, how do I get it on the computer?
 
John Dell'Oso
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kevin Tysen:
What is a JRE and how do I find out whether or not it's already on the computer, and if it's not, how do I get it on the computer?


JRE = Java Runtime Environment.

On Windows you can check if the JRE is in the list of registered programs installed on the client. You can do this via Control Panel and Add/Remove Programs. If you're not familiar with Windows, perhaps you know someone who is that can help you out.

If the client has the JDK (Java Development Kit) installed, then you don't require a standalone JRE as the JDK includes the JRE. If you do need the JRE you can download load it from Sun Java website.

Regards,
JD
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found out where to download the JRE on the Sun website. It's part of the JDK, which is part of J2SE. I downloaded the installer for the JDK, the small one which is for computers connected to the internet, and I double clicked on it, but I got a message that "This machine does not have sufficient memory to run this program." What can I do? This is a Windows 98 Japanese OS with a 32MB SDRAM memory.
According to what I read on the internet page, if I read it right, in order to get JRE, you have to get the JDK installer going and then choose only the JRE to install, if you want only the JRE. Is that right?
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have any advice for me? Should I try to download an older version of J2SE or something like that? Do the installers of the older versions take up less memory?
 
John Dell'Oso
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kevin Tysen:
I found out where to download the JRE on the Sun website. It's part of the JDK, which is part of J2SE. I downloaded the installer for the JDK, the small one which is for computers connected to the internet, and I double clicked on it, but I got a message that "This machine does not have sufficient memory to run this program." What can I do? This is a Windows 98 Japanese OS with a 32MB SDRAM memory.
According to what I read on the internet page, if I read it right, in order to get JRE, you have to get the JDK installer going and then choose only the JRE to install, if you want only the JRE. Is that right?


I think you'll find that 32MB will not be sufficient (for Java 1.5.x). There will be little difference (if any) in memory requirements for older versions as well. A minimum of 64MB seems to be the norm - but depending on the type of application you are trying to run, you'll probably find 64MB to be on the small side.

See this link for more info:
JRE 5.0 System Requirements

As far as I know you should be able to download the JRE separately. I usually download the JDK, so I may be wrong. However this page seems to suggest that the JRE can be downloaded as a separate unit.

Download Java 2 Platform

Regards,
JD
[ March 01, 2006: Message edited by: John Dell'Oso ]
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the advice. I downloaded the installer that installs only the JRE, but that doesn't work either because there is not enough RAM memory in this computer. I guess I'll try to find an older version of java to install, and if that doesn't work, I'll try something else.
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found J2SDK 1.3 and 1.4 on Sun's home pages, and tried them out. I was able to install 1.3 on this computer. I noticed that the 1.3 version installer was a different kind from the type I tried with 1.4 and 1.5. With 1.4 and 1.5, the installer was the kind where you download a small file and that enables you to install directly from Sun' home page. With 1.3, that type was not available, so I downloaded the big file which installs java on the computer without connecting to the internet. Perhaps you need a lot of RAM memory only if you are using the installer which connects to the internet. Maybe I'll try the non-internet-connecting installer for 1.5.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!