Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - setting classpath

My sample application tells me:

No 'qtjambi-deployment.xml' found in classpath, loading
libraries via 'java.library.path'

I wish for my application to use the qtjambi-deployment.xml, but unfortunately can't find the appropriate setting in IntelliJ IDEA 10.5.

Could someone help me?

like image 718
Yippie-Ki-Yay Avatar asked May 24 '11 00:05

Yippie-Ki-Yay


People also ask

What should classpath be set to in Java?

The default value of CLASSPATH is a dot (.). It means the only current directory searched. The default value of CLASSPATH overrides when you set the CLASSPATH variable or using the -classpath command (for short -cp). Put a dot (.)

How do I know if my classpath is set correctly?

To check our CLASSPATH on Windows we can open a command prompt and type echo %CLASSPATH%. To check it on a Mac you need to open a terminal and type echo $CLASSPATH.

What is the default Java classpath?

From The Java™ tutorials: PATH and CLASSPATH: The default value of the class path is ".", meaning that only the current directory is searched. Specifying either the CLASSPATH variable or the -cp command line switch overrides this value.

What is a classpath and how do I set it?

Classpath is a parameter in the Java Virtual Machine or the Java compiler that specifies the location of user-defined classes and packages. The parameter may be set either on the command-line, or through an environment variable.


1 Answers

You can right click on any directory in your IntelliJ project, select "Mark Directory As...", and choose "Source Root". That director folder will change color from yellow to blue; IntelliJ considers all those directories to be in your CLASSPATH.

like image 126
duffymo Avatar answered Sep 19 '22 16:09

duffymo