title: running 32 bit jvm alongside 64 bit jvm in eclipse
body: <p>I am trying to create a connection to a 32 bit Microsoft access 2010 database using Java and 64 bit eclipse eclipse in windows 7.  </p>
  
  <p>I created a 32 bit system dns by reading <a href="http://answers.microsoft.com/en-us/office/forum/officeversion_other-access/64-bit-driver-for-dsn-for-ms-access-database/be8c0ad4-d8fd-48e0-9026-b95d84135820" rel="nofollow">this link</a>.  The program to create the 32 bit dns is located at:  </p>
  
  <pre><code>c:\windows\sysWOW64\odbcad32.exe  
  </code></pre>
  
  <p>In an attempt to configure eclipse to run the java class as 32-bit, I selected Run as... Run Configurations --> (Arguments tab)  and entered -d32 in the VM Arguments box, then clicked run.  However, trying to run the program resulted in a dialog box saying:  </p>
  
  <pre><code>"Could not create the java virtual machine"  
  </code></pre>
  
  <p>Here is the code for the class I am using to test a connection to the system dns:  </p>
  
  <pre><code>public class SoftwareDeveloper {
      public static void main(String[] args){ 
          try {
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection conn = DriverManager.getConnection("jdbc:odbc:MYDSNCONNECTION");
              Statement st = conn.createStatement();
              ResultSet rest = st.executeQuery("SELECT * FROM myTable");
              while(rest.next()){
                  System.out.println(rest.getString(1));
                  System.out.println(rest.getString(2));
              }
          }
          catch (ClassNotFoundException cnfe){cnfe.printStackTrace();}
          catch (SQLException e) {e.printStackTrace();}
      }
  }
  </code></pre>
  
  <p>I am guessing this means I created a 32 bit system dns successfully, but that eclipse is not able to find a 32 bit jdk.  I want to keep using 64 bit jdk with eclipse, but is there some way to configure eclipse so that it can switch from a default 64 bit jdk to a 32 bit jdk when -d32 is given in the run configurations?  Or is there another solution?  </p>
  
  <p>NOTE: Installing 64 bit version of MS Access or deleting Access and downloading an Access database engine from Microsoft are not options for unrelated reasons.  </p>