Hello, I have Java j2sdk1.4.1 as the default java mahine. (i.e. the java command work


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Hello, I have Java j2sdk1.4.1 as the default java mahine. (i.e. the java command work

  1. #1
    Join Date
    Oct 2004
    Posts
    3

    Hello, I have Java j2sdk1.4.1 as the default java mahine. (i.e. the java command work

    Hello, I have Java j2sdk1.4.1 as the default java mahine. (i.e. the java command works from any directory)
    but i have also j2sdk1.4.2_05.

    my question is, when i open the bin directory of the j2sdk1.4.2_05 and type : javac myfile.java
    which compiler will work?

  2. #2
    Join Date
    Oct 2004
    Posts
    311

    Re: Hello, I have Java j2sdk1.4.1 as the default java mahine. (i.e. the java command

    Originally posted by tleis
    Hello, I have Java j2sdk1.4.1 as the default java mahine. (i.e. the java command works from any directory)
    but i have also j2sdk1.4.2_05.

    my question is, when i open the bin directory of the j2sdk1.4.2_05 and type : javac myfile.java
    which compiler will work?
    In this case it will use the 1.4.2_05 compiler.
    The operating system (I'm asuming you use windows) checks the current dir first, to see if the app you define in your program is located there. If it finds it, it runs that one, if it doesn't find it in the current dir, it checks the dirs you specified in your System Path.
    which in your case would result in it using the version 1.4.1 of the compiler.

  3. #3
    Join Date
    Oct 2004
    Posts
    3
    Thank you very much

    I was told about a cool way to check which one is used, by typing java -version, and it turned out that you are right.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center