Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7191592

Will making ndk Apps of Android

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 7
    • deploy

      FULL PRODUCT VERSION :
      java version "1.7.0_02"
      Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
      Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :

      'sysinfo' is not recognized as an internal or external command,
      operable program or batch file.
      OS Name: Microsoft Windows 7 Home Basic
      OS Version: 6.1.7600 N/A Build 7600
      OS Manufacturer: Microsoft Corporation
      OS Configuration: Standalone Workstation
      OS Build Type: Multiprocessor Free
      Registered Organization:
      Product ID: 00346-339-0000007-85239
      Original Install Date: 28/11/2011, 3:21:33 PM
      System Boot Time: 15/08/2012, 9:44:37 AM
      System Manufacturer: Acer
      System Model: Aspire 5738
      System Type: X86-based PC
      Processor(s): 1 Processor(s) Installed.
                                 [01]: x64 Family 6 Model 23 Stepping 10 GenuineIntel
      ~2100 Mhz
      BIOS Version: Phoenix Technologies LTD V1.12 , 24/06/2009
      Windows Directory: C:\Windows
      System Directory: C:\Windows\system32
      Boot Device: \Device\HarddiskVolume1
      System Locale: en-us;English (United States)
      Input Locale: en-us;English (United States)
      Time Zone: (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi
        Total Physical Memory: 3,001 MB
      Available Physical Memory: 800 MB
      Virtual Memory: Max Size: 6,000 MB
      Virtual Memory: Available: 3,341 MB
      Virtual Memory: In Use: 2,659 MB
      Page File Location(s): C:\pagefile.sys
      Domain: WORKGROUP
      Logon Server: \\SAKURA-PC
      Hotfix(s): 19 Hotfix(s) Installed.
                                 [01]: 982861
                                 [02]: KB2286198
                                 [03]: KB2296011
                                 [04]: KB2296199
                                 [05]: KB2347290
                                 [06]: KB2454826
                                 [07]: KB2476490
                                 [08]: KB2532531
                                 [09]: KB2536276
                                 [10]: KB2588516
                                 [11]: KB2619339
                                 [12]: KB2620712
                                 [13]: KB958488
                                 [14]: KB980195
                                 [15]: KB980232
                                 [16]: KB980436
                                 [17]: KB981957
                                 [18]: KB982132
                                 [19]: KB982214
      Network Card(s): 3 NIC(s) Installed.
                                 [01]: Intel(R) WiFi Link 5100 AGN
                                       Connection Name: Wireless Network Connection
                                       DHCP Enabled: Yes
                                       DHCP Server: 192.168.1.1
                                       IP address(es)
                                       [01]: 192.168.1.2
                                       [02]: fe80::6d85:422d:6c8a:d7f2
                                 [02]: Broadcom NetLink (TM) Gigabit Ethernet
                                       Connection Name: Local Area Connection
                                       Status: Media disconnected
                                 [03]: VirtualBox Host-Only Ethernet Adapter
                                       Connection Name: VirtualBox Host-Only Network
                                       DHCP Enabled: No
                                       IP address(es)
                                       [01]: 192.168.56.1
                                       [02]: fe80::547b:9737:a465:56e6


      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Acer Aspire 5738
      Ram:3GB
      Hard Disk: 320GB

      A DESCRIPTION OF THE PROBLEM :
      C:\Users\sakura\workspace\Hello World\src\com\example\hello\world>javah -jni HelloWorld.java
      An exception has occurred in the compiler (1.7.0_02). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.ClassCastException: com.sun.tools.javac.api.ClientCodeWrapper$WrappedJ
      avaFileManager cannot be cast to com.sun.tools.javac.file.JavacFileManager
              at com.sun.tools.javac.main.Main.compile(Main.java:413)
              at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
              at com.sun.tools.javah.JavahTask.run(JavahTask.java:513)
              at com.sun.tools.javah.JavahTask.run(JavahTask.java:335)
              at com.sun.tools.javah.Main.main(Main.java:46)

      REGRESSION. Last worked in version 7

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Start ur Android Application in eclipse
      2. Make use native keyword to make ndk apps.
      3. Run using javah -jni filename.java
      4. Error


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package com.example.hello.world;

      import android.os.Bundle;
      import android.app.Activity;
      import android.view.Menu;
      import android.widget.TextView;

      public class HelloWorld extends Activity {

          @Override
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_hello_world);
              TextView myTextField = (TextView)findViewById(R.id.menu_settings);
              myTextField.setText(stringFromJNICPP());
          }
          
          public native String stringFromJNI();
          
        public native String stringFromJNICPP();
          
          /* this is used to load the 'hello-jni' library on application
           * startup. The library has already been unpacked into
           * /data/data/com.example.HelloJni/lib/libhello-jni.so at
           * installation time by the package manager.
           */
          static {
              System.loadLibrary("TestJNI");
          }
          
          @Override
          public boolean onCreateOptionsMenu(Menu menu) {
              getMenuInflater().inflate(R.menu.activity_hello_world, menu);
              return true;
          }
      }

      ---------- END SOURCE ----------

      SUPPORT :
      YES

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: