-5

主にJavaクラスを実行するためにEclipseを使用しているので、Eclipseを使用していないかどうかを知りたいのですが、Javaプログラムを実行したい場合は、パスとクラスパスも手動で設定する必要があります。 C: ドライブの Java フォルダー内の jdk と、私のプログラムは Temp.java という名前の AA という名前のフォルダー内にあります。コマンド ウィンドウ自体から Java プログラムを実行するために、パスとクラスパスを設定する方法をアドバイスしてください..!

4

2 に答える 2

2

インストールjdk binパスの環境パスを設定すると、任意の場所からJavaプログラムをコンパイルして実行できます。

My compute->right click->system properties->advanced tab->select system variable path-> select edit->then add your jdk bin path. save the setting.

Windows でのパスの設定

Windows 7
Select Computer from the Start menu
Choose System Properties from the context menu
Click Advanced system settings > Advanced tab
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Reopen Command prompt window, and run your java code.

参照

于 2012-08-26T04:44:28.697 に答える
1

次を使用して、現在の作業ディレクトリへのパスを設定できます。

path=%path%;c:\Java\jdk[followedbyversion]\bin

これによりパスが一時的に設定され、システムの新規起動時にパスを再度設定する必要があります。

Windows で作業している場合は、環境変数を使用してパスを永続的に設定できます。マイコンピュータを右クリック -> プロパティ -> 詳細システム設定 -> 環境変数 -> 次に、ユーザー環境変数を追加し、パスに名前を付けて、jdk の bin へのパスを設定します。

于 2012-08-26T04:45:49.593 に答える