Solved

Only Java Run Time

Posted on 2011-03-25
7
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

738 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