title: JNI can not find native method (test\Test.java:11: cannot find symbol)
body: <p>i am following <a href="http://www.javamex.com/tutorials/jni/getting_started.shtml" rel="nofollow">this tutorial</a> on jni. </p>
  
  <p>1) Steps made a test\Test.java file with method </p>
  
  <pre><code>public native static int getDouble(int n);
  </code></pre>
  
  <p>2) Compiled and generated a header file. (javac, javah)</p>
  
  <p>3) Created a VC Win32 Project (Application Type: DLL) </p>
  
  <p>4) Changed project properties to include</p>
  
  <pre><code>%JAVA_HOME%\include;%JAVA_HOME\include\win32\
  </code></pre>
  
  <p>5) Copy pasted test_Test.h in vc project. </p>
  
  <p>6) Build > Confugration Manager (Changed platform to x64)</p>
  
  <p>7) Build Solution + Copy resulting .dll file to Test.java Class path</p>
  
  <p>8) Change Test.java to include call the the native funciton call.</p>
  
  <pre><code>package test;
  
  public class Test {
  
      public native static int getDouble(int n);
  
      public static void main(String[] args) {
          System.loadLibrary("jni_example");
  
          for (int n = 1; n &lt;= 20; n++) {
              System.out.println(n + " x 2 = " + getDoubled(n));
          }
      }
  }
  </code></pre>
  
  <p>9) Trying compile Test again gives a problem .</p>
  
  <pre><code>D:\workspace\jni_example&gt;ls
  jni_example.dll  test  test_Test.h
  
  D:\workspace\jni_example&gt;javac -classpath . test\Test.java
  test\Test.java:11: cannot find symbol
  symbol  : method getDoubled(int)
  location: class test.Test
                          System.out.println(n + " x 2 = " + getDoubled(n));
                                                             ^
  1 error
  </code></pre>
  
  <p>When i comment out the System.out line it works ok ofcourse without printing anything. </p>
  
  <pre><code>D:\workspace\jni_example&gt;java -version
  java version "1.6.0_30"
  Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
  Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
  </code></pre>
  
  <p>where am i going wrong with this?</p>