Solved

Only Java Run Time

Posted on 2011-03-25
7
315 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 83 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now