Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
If a class is located in a package, what do you need to change in the OS environment to be able to use it?
If a class is located in a package, what do you need to change in the OS environment to be able to use it?
✍: Guest
You need to add a directory or a jar file that contains the package directories to the CLASSPATH environment variable. Let's say a class Employee belongs to a package com.xyz.hr; and is located in the file c:\dev\com\xyz\hr\Employee.java. In this case, you'd need to add c:\dev to the variable CLASSPATH. If this class contains the method main(), you could test it from a command prompt window as follows:
c:\>java com.xyz.hr.Employee
2012-05-28, 2400👍, 0💬
Popular Posts:
What’s the difference between Unit testing, Assembly testing and Regression testing? Unit testing is...
How Do I Run JUnit Tests from Command Window? To run JUnit tests from a command window, you need to ...
How To Define a Data Source Name (DSN) in ODBC Manager? - Oracle DBA FAQ - ODBC Drivers, DSN Configu...
In which event are the controls fully loaded ? Page_load event guarantees that all controls are full...
How To Use "IN OUT" Parameter Properly? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and F...