Solved

Only Java Run Time

Posted on 2011-03-25
7
352 Views
Last Modified: 2012-05-11
If I have a Java application,
and I want to run it on an OS (e.g., Linux, HP Unix, etc)
I am NOT allowed to install Java Run Time on it.

Which environment variables am I need to set in order to make the application can be executed?
PATH? JAVA_HOME? or other variables?

Thanks!
0
Comment
Question by:mawingho
7 Comments
 
LVL 8

Accepted Solution

by:
colr__ earned 250 total points
ID: 35216287
If you cant install JVM, then you arent going to get this working. PATH is used to make the java bin directory commans available to the command line, JAVA_HOME is used by some applications, like apache tomcat, to point to the java installation root. However if you arent able to install java, then pointing these anywhere wont make any difference - you need to install java to run a java app!
0
 
LVL 12

Assisted Solution

by:enachemc
enachemc earned 83 total points
ID: 35216333
neither
just call the java.exe using the full path
provide correct classpath and all should run OK on your JRE copy
0
 
LVL 8

Assisted Solution

by:colr__
colr__ earned 250 total points
ID: 35216386
Are you able to copy the jre to the computer as enachemc suggested? This would work - I had assumed you meant you couldnt put the jre on the machine at all.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 83 total points
ID: 35216623
If you are not allowed to install JRE yourself, there is a good chance
you have java pre-installed on your machine.
Did you try to run

java -version

0
 
LVL 8

Assisted Solution

by:colr__
colr__ earned 250 total points
ID: 35219202
Java may be installed but not available in the path, in which case java - version wont work. Youd need to determine from the add/remove programs if it is installed, then find the location and add it to the PATH. That way you can then run your java programs
0
 
LVL 2

Assisted Solution

by:calboronster
calboronster earned 84 total points
ID: 35225057
Your question is a bit confusing with less details so let me answer it in question form -

1. By Java application do you mean .class/.jar file. And how do you try to execute it?
(Or is it web application, which makes the answer a bit more difficult)

to run .class file you execute
<java location>/bin/java.exe -cp <libraries path> abc.class

Open in new window

in your class folder
to run packaged .jar file you execute  
<java location>/bin/java.exe -jar abc.jar

Open in new window

in your jar folder

2. If the jar file is setup (on windows) to open with javaw, then double click on the same should do exactly as the last two commands. Albeit the java location (upto /bin) should be mentioned in windows environment variable.

3. Most of the applications inherently find the java location based on variable JAVA_HOME (which refers to java installable, not bin folder but its parent). Try this for all java apps to execute without additional questions from the app.
0
 

Author Closing Comment

by:mawingho
ID: 35305463
thanks
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Configuring Apache Camel to send and recieive from QPID Broker 2 29
lunix and unix command 21 115
rsyslog raw message 4 36
Shell Script- gzip 5 46
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question