• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

environment variable problem

 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my environment variable is set to C:\Program Files\Java\jdk1.5.0_05.

Consider the following code.



i ran this class in MS DOS.

Output is D:\Program Files\IBM-AppClient\java\jre

but this path is my jboss's installed jre's path.

what about the JAVA_HOME given in environment variable. shouldn't it be displayed?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by krishna prasad gunasekaran:
my environment variable is set to C:\Program Files\Java\jdk1.5.0_05.


Which environment variable? There are many environment variables on your system. Do you mean JAVA_HOME?

Output is D:\Program Files\IBM-AppClient\java\jre

but this path is my jboss's installed jre's path.

what about the JAVA_HOME given in environment variable. shouldn't it be displayed?


The environment variable JAVA_HOME does not determine which version of Java is used. In fact, JAVA_HOME is not used at all by Java (some third-party programs use it to find where the JRE is).

Instead of setting JAVA_HOME, you should add the bin directory of the JRE you want to use to the PATH environment variable.
 
krishna prasad gunasekaran
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks young,
Now i am using PATH instead of JAVA_HOME.

still my question is why the JAVA_HOME environment variable isn't considered as java home and Jboss's installed jre path is considered instead?

the original problem of mine is in jboss jmx console.
when i invoked the list method under JNDIView Service, the browser displays the following error.



if JAVA_HOME is not pointing to a JDK, where else is it pointing to? the jboss's installed jre?
[ November 27, 2008: Message edited by: krishna prasad gunasekaran ]
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suspect in this case the Jboss startup script uses the '3rd party way of finding the jdk' by overwriting JAVA_HOME, check out the startup script for that value.
 
krishna prasad gunasekaran
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello Verburg,
if it is jboss start up script issue, what jboss has to do with msdos. even when i run the class file in msdos prompt, it still displays that jboss installed jre path. why?
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

OK, try this from the command line:

echo %JAVA_HOME%
echo %PATH%
echo %JBOSS_HOME%

The %PATH% will be the interesting one as it will list in order which Java installations that MSDOS can access. You may find that the Jboss one is listed before your straight Java install.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic