0

CK71 ATEX Intermec スキャナー用のバーコード リーダーを実装しようとしています。オペレーティング システムはWindows Embedded Handheld 6.5で、JVM としてphoneME Personal Profileを使用しています。DC_Java_WM6_Armv4i.cab をインストールしました (図を参照)。

ここに画像の説明を入力

以下のコードを実行すると、次のエラーが発生しますITCScan failed to load. java.lang.UnsatisfiedLinkError: no ITCScan.dll in java.library.path

このエラーを修正するにはどうすればよいですか? 私はすべてを試しました。

以前はCreME JVMを使用していましたが、すべて正常に動作していたことに注意してください。30 日間の評価版の有効期限が切れたときに、CreME をあきらめました。

.lnk ファイルの内容 (myProject.MainClass の代わりに、もちろん実際の名前です):

255#"\Program Files\pMEA PP\bin\cvm.exe" "-Xopt:stdioPrefix=\My Documents,useConsole=false" -cp "\My Documents\Trasabilitate.jar;\My Documents\DataCollection.jar" myProject.MainClass

完全なコードは次のとおりです。

/*
 * BarcodeSample.java
 *
 * COPYRIGHT (c) 2004 INTERMEC TECHNOLOGIES CORPORATION, ALL RIGHTS RESERVED
 */

import java.awt.*;

import com.intermec.datacollection.*;


/**
 * This sample demonstrates using the BarcodeReader class to
 * read barcode data into a text field.
 */
public class BarcodeSample extends Frame implements BarcodeReadListener
{
    BarcodeReader bcRdr;
    TextField txtFieldData;
    Button btnClose;
    Label  labelStatus;

    public BarcodeSample(String aTitle)
    {
        super(aTitle);
        initComponents();

        try
        {
            bcRdr = new BarcodeReader();
            bcRdr.addBarcodeReadListener(this);
            // Starts asynchronous barcode read
            bcRdr.threadedRead(true);
        }
        catch (BarcodeReaderException e)
        {
            System.out.println(e);
            labelStatus.setText(e.getMessage());
            //*****
            //* Since m_labelStatus was not initialized with text,
            //* doLayout() is required on some platforms in order
            //* to show the new label text for the first setText()
            //* call.
            //*****
            doLayout();
        }
    }

    private void initComponents()
    {
        setLayout(new FlowLayout());
        txtFieldData = new TextField(20);
        add(txtFieldData);
        btnClose = new Button("Close");
        add(btnClose);
        labelStatus = new Label();
        add(labelStatus);

        btnClose.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent e)
            {
                exitApp();
            }
        });
        btnClose.addKeyListener(new java.awt.event.KeyListener() {
            public void keyPressed(java.awt.event.KeyEvent e) {
                if (e.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER)
                {
                    exitApp();
                }
            }
            public void keyReleased(java.awt.event.KeyEvent e) {}
            public void keyTyped(java.awt.event.KeyEvent e) {}
        });
    }

    /**
     * This method is invoked when the BarcodeReadEvent occurs.
     */
    public void barcodeRead(BarcodeReadEvent aBarcodeReadEvent)
    {
        /**
         * Uses EventQueue.invokeLater to ensure the UI update
         * executes on the AWT event dispatching thread. 
         */
        final String sNewData = aBarcodeReadEvent.strDataBuffer;
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                // Displays the scanned data in the text field
                txtFieldData.setText(sNewData);             
            }
        });
    }

    public void exitApp()
    {
        if (bcRdr != null)
            bcRdr.dispose(); // Release system resources used by BarcodeReader
        setVisible(false);
        dispose(); // Dispose the frame
        System.exit(0);
    }

    public static void main(String[] args)
    {
        final BarcodeSample asyncReader =
            new BarcodeSample("Barcode Sample");
        asyncReader.addWindowListener(new java.awt.event.WindowAdapter()
        {
            public void windowClosing(java.awt.event.WindowEvent e)
            {
                asyncReader.exitApp();
            };
        });

        asyncReader.setVisible(true);
    }
}
4

1 に答える 1

0

私はついにそれを働かせました。ここでスニペットを使用していた Java パスを見つけました(リンクに何か問題が発生した場合に備えて、以下に投稿します)。

Properties p = System.getProperties();
Enumeration keys = p.keys();
while (keys.hasMoreElements()) {
    String key = (String)keys.nextElement();
    String value = (String)p.get(key);
    System.out.println(key + ": " + value);
}

そして、 ITCScan.dll を java.library.path が設定されたフォルダー (私の場合は \ProgramFiles\pMEA PP\bin.

これが最もエレガントなソリューションかどうかはわかりませんが、機能します。いつか誰かの役に立てば幸いです。

于 2016-10-17T13:27:28.177 に答える