Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のフォルダー構造があると仮定します。
'source' フォルダーにいることを認めて、クラス MyClass.class を実行するためにどのコマンド 'java.exe' を使用しますか?
クラスフォルダーのクラスパスを指定する必要があるため、次のことを行う必要があります。
java -cp ../classes com.wickedlysmart.MyClass
または
java -cp <full-path-to>/classes com.wickedlysmart.MyClass
注: これは、同じレベルのcomとを持つ階層を使用して、投稿でエラーが発生したことを前提としています。wickedlysmartそれらが同じレベルにある必要がある場合はcom.、上記の例から を削除してください。
com
wickedlysmart
com.