Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!

sam salo

Greenhorn
+ Follow
since Jun 08, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sam salo

Thank you Ireneusz the code worked for my dll just fine, you have saved me hours of work.
9 years ago

I have a dll called isapi_redirect.dll, I trying to see if there is any way in Java to read the Dll version for some validation?
Is there a work around or a hack to read the dll version?.
I Google it and did not find a direct way of doing it. There are third party tool that let you read the version..
Any suggestion? tryng to write a junit test.
Thanks




9 years ago
I think that you have Oracle middle ware/components installed on the E drive, and the system is using the JRE that comes with oracle, just take the Oracle Path away to see what will happen;
E:\oracle\product\10.1.0\db_1\jre\1.4.2\bin;E
9 years ago
Multi booting OS’s can have wired problems.
I did this on windows 2008.

I would think when you logon to the windows 7 machine, you would go to the control panel/ system /Environment Variable
Check if the JAVA_HOME is defined and what value it has.
Check the path variable and verify that no Java point to the C Ddrive.

How did you set the path variable? make sure that there is no overlapping, system will pickup the first parameters in the path.


9 years ago

Paul Clapham wrote:Maybe you should stick to playing hockey for another few years?



No, just joking, carry on with the Java!



You are a piece of ART, why waste your time here, you should be a comedian.

9 years ago
Rob Prime You are great man, I was not ignoring your post, I appreciate your help, just things were moving 2 fast for me, or I feel that there was a delay in the appearance of the post
9 years ago
Yes The orginal code is working after I changes this line from



to



2 Solutions is hand
9 years ago
Thank you for the quick response
Yes I will put future code in code tags.
The issue that I having, there is no console output or print out from the command line when I run the program that I provided.
Yes there is an output when I execute this portion of the code.


but once I add the -version there is no output, not sure why, is locking or what ?
The provided solution by Peter Taucher seems to be working fine, thank you, but I thought it is an overkill for what I'm trying to do and that is writting simple junit to check for the java -verison.
At least now I have a solution that I can use.
9 years ago
How can I make this program work ? thanks I can not do java -version and guessing the space is producing an issue

import java.io.*;
public class TestExec {
public static void main(String[] args) {
String[] command = new String[4];
command[0] = "cmd";
command[1] = "/C";
command[2] = "java";
command[3] = "-version";
try {
Process p = Runtime.getRuntime().exec(command);
BufferedReader in = new BufferedReader(
new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
9 years ago