

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Set PATH and CLASSPATH in Java?
Set path
Assuming you have installed Java in c:\Program Files\java\jdk directory −
Right-click on 'My Computer' and select 'Properties'.
Click the 'Environment variables' button under the 'Advanced' tab.
Now, alter the 'Path' variable so that it also contains the path to the Java executable. Example, if the path is currently set to 'C:\WINDOWS\SYSTEM32', then change your path to read 'C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin'.
Set Classpath
Assuming you have stored your Java programs in c:\myprograms\ directory −
Right-click on 'My Computer' and select 'Properties'.
Click the 'Environment variables' button under the 'Advanced' tab.
Now, add the 'CLASSPATH' variable and set the path to the c:\myprograms\'.
- Related Questions & Answers
- What is the difference between PATH and CLASSPATH in Java?
- How to set path in Java?
- How to set CLASSPATH variable for JDK?
- How to set Java Path in Linux OS?
- How to set Java Path in Mac OS?
- Get ClassPath from RuntimeMXBean in Java
- How to set your python path on Linux?
- How to set your python path on Mac?
- How to set your python path on Windows?
- How to Set Temporary Path of JDK in Windows?
- How to Set Permanent Path of JDK in Windows?
- What are classpath of projects in Java eclipse projects?
- Set the image path with CSS
- How to set Temporary and Permanent Paths in Java?
- Fix Connectivity error in Java MySQL connection for connector to be set to class path?
Advertisements