jdk/bin/jpsshould list all the java process IDs running that system- subsequently invoke
jdk/bin/jinfo <pid>to see lot of information... what you require is also there...
jdk/bin/jpsshould list all the java process IDs running that system- subsequently invoke
jdk/bin/jinfo <pid>to see lot of information... what you require is also there...
No need to print the default classpath. In Java, the default classpath is just the current directory:
If -classpath and -cp are not used and CLASSPATH is not set, the user class path consists of the current directory (.).
(documentation of java:)
Note: For completeness' sake: Theree are two other paths where java will look for stuff:
- the bootstrap class path
- the extension directory
The bootstrap class path by default points to parts of the JDK, and you almost never want to mess with it (unless you want to override part of the JDK), so you probably should not worry about it. The extension directories are for extending the JDK; see http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/index.html
Videos
In Intellij 13, it looks it's slightly different again. Here are the instructions for Intellij 13:
- click on the Project view or unhide it by clicking on the "1: Project" button on the left border of the window or by pressing Alt + 1
- find your project or sub-module and click on it to highlight it, then press F4, or right click and choose "Open Module Settings" (on IntelliJ 14 it became F12)
- click on the dependencies tab
- Click the "+" button on the right and select "Jars or directories..."
- Find your path and click OK
- In the dialog with "Choose Categories of Selected File", choose
Classes(even if it's properties), press OK and OK again - You can now run your application and it will have the selected path in the class path
It appears that IntelliJ 11 has changed the method, and the checked answer no longer works for me. In case anyone else arrives here via a search engine, here's how I solved it in IntelliJ 11:
- Go to the Project Structure, click on Modules, and click on your Module
- Choose the "Dependencies" tab
- Click the "+" button on the right-hand side and select "Jars or directories..."
- Add the directory(ies) you want (note you can multi-select) and click OK
- In the dialog that comes up, select "classes" and NOT "jar directory"
- Make sure you're using that Module in your run target
Note that step 5 seems to be the key difference. If you select "jar directory" it will look exactly the same in the IDE but won't include the path at runtime. There appears to be no way to determine whether you've previously selected "classes" or "jar directory" after the fact.