CLASSPATH on Mac, and how Mac is looking for mysql-connector-java-bin.jar

Is there a default class path in Mac OS X 10.6? When I echo $CLASSPATH, nothing will appear. In mine, .profileI see only a variable PATH. My problem is that My servlet can not seem like a suitable driver for connecting to mysql server. I use Eclipse, with Glassfish v3and MAMPfor the MYSQL server.

+3
source share
3 answers

There are several ways to get the JAR for Java on Mac OS X:

  •  
  • Put it in / Library / Java / Extensions  
  • Create / Modify CLASSPATH Environment Variable 
  • Set the class path explicitly with the -cp option.

CLASSPATH , , . , , ~/.profile, GUI. , , ~/.MacOSX/environment.plist, . , , .

, JAR CLASSPATH, , , . JAR , . Apache Maven2 , , ,

+11

CLASSPATH. . Sun. , , , . . , appservers ( IDE) . Do JRE JDK. . JRE/JDK , .

web- , webapp, Webapp/WEB-INF/lib. classpath webapp. (, JDBC JNDI, ), Appserver/lib. classpath . Glassfish /lib, . glassfish/domains/<domainname>/lib.

+5

. appserv-rt.jar( Glassfish lib) . ( , , , .

+1
source

Source: https://habr.com/ru/post/1738353/


All Articles