C:\ JiBXの\チュートリアル\ example23 \ 例23は、今、私はCustomerManagerのJavaをコンパイルしようとしています以下のファイルに難しさのjavacでコンパイルする - 私は、次のディレクトリ構造を持っている問題
が含まれていますCustomerManagerのJavaファイルのため、このfolder.Theコード内の他のクラスを参照するだけで、ファイルが
package example23;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import org.jibx.runtime.*;
public class CustomerManager
{
public CustomerManager()
{
try
{
IBindingFactory bfact = BindingDirectory.getFactory(Customer.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
Object obj = uctx.unmarshalDocument(new FileInputStream("C:/jibx/tutorial/example23/customer.xml"), null);
Customer customer = (Customer)obj;
System.out.print(customer.street+", "+customer.city);
IMarshallingContext mctx = bfact.createMarshallingContext();
mctx.setIndent(4);
mctx.marshalDocument(obj, "UTF-8", null, new FileOutputStream("C:/jibx/tutorial/example23/customer2.xml"));
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
catch (JiBXException e)
{
e.printStackTrace();
}
} //end method
public static void main(String[] args)
{
new CustomerManager();
}
}//end class
簡単です今、このファイルには、私のファイルへの参照が含まれています\ JiBXの\ libに(ファイル自体はc:\ JiBXの\チュートリアル\ example23)CなどのTSトップディレクトリ
私はこれらのライブラリを参照するようにして、ファイル
C:\jibx\tutorial>javac -classpath c:\jibx\lib\ example23\CustomerManager.java
and the output i got was
example23\CustomerManager.java:7: error: package org.jibx.runtime does not exist
import org.jibx.runtime.*;
^
example23\CustomerManager.java:16: error: cannot find symbol
IBindingFactory bfact = BindingDirectory.getFactory(Customer.class);
^
symbol: class IBindingFactory
location: class CustomerManager
example23\CustomerManager.java:16: error: cannot find symbol
IBindingFactory bfact = BindingDirectory.getFactory(Customer.class);
^
symbol: class Customer
location: class CustomerManager
example23\CustomerManager.java:16: error: cannot find symbol
IBindingFactory bfact = BindingDirectory.getFact
ory(Customer.class);
^
symbol: variable BindingDirectory
location: class CustomerManager
example23\CustomerManager.java:17: error: cannot find symbol
IUnmarshallingContext uctx = bfact.createUnmarsh
allingContext();
^
symbol: class IUnmarshallingContext
location: class CustomerManager
example23\CustomerManager.java:20: error: cannot find symbol
Customer customer = (Customer)obj;
^
symbol: class Customer
location: class CustomerManager
example23\CustomerManager.java:20: error: cannot find symbol
Customer customer = (Customer)obj;
^
symbol: class Customer
location: class CustomerManager
example23\CustomerManager.java:22: error: cannot find symbol
IMarshallingContext mctx = bfact.createMarshalli
ngContext();
^
symbol: class IMarshallingContext
location: class CustomerManager
example23\CustomerManager.java:30: error: cannot find symbol
catch (JiBXException e)
^
symbol: class JiBXException
location: class CustomerManager
9 errors
C:\jibx\tutorial>
をコンパイルするには、以下を試してみましたどのように私はcldはこの問題を解決する上で任意の提案?
昨日のおかげでも、あなたが同じ問題を抱えていたし、このフォーラムは、あなたのクラスパスを修正するためにあなたをお勧め
。進んでいく前にPATH/CLASSPATHを見てみてください。 – Satya
はい、なぜ私は別の投稿を始めたのか、それらを見ました。私はこれらの投稿に返信するつもりだったが、AddCommentセクションは本当に役に立たなかった。 – Rajeshwar