• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Xcode and Java searchpath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Xcode and Java searchpath


  • Subject: Xcode and Java searchpath
  • From: David Hill <email@hidden>
  • Date: Sat, 17 Feb 2007 14:38:13 -0700

I am a beginner with Java and Xcode.

I downloaded the Java Connector/J from the internet and copied the .jar file to the following location.
/Users/laurel/JavaJars/mysql-connector-java-5.0.4-bin.jar

In Xcode I added a /Users/Laurel/JavaJars to the Java Class Search Paths for the Active Target.

In the Executible target I added:
-classpath /Users/laurel/JavaJars/mysql-connector-java-5.0.4-bin.jar

(I tried with and without double quotes around the file name)

Here is my code....

import java.util.*;
import java.sql.*;

public class DavidJava {

     public static void main (String args[]) {


try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
System.out.println("SUCCESS");
}
catch(Exception e)
{
System.err.println(e.getCause());
System.err.println(e);
}
     }
}

And this is what I get when I build and run my code.

[Session started at 2007-02-17 13:58:03 -0700.]
null
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

java has exited with status 0.

This class should be in the .jar file as long as it is found.
No doubt I am missing something simple, but I am stuck.

Any help would be appreciated.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: What are your top desired improvements in Xcode ?
  • Next by Date: How to control link order ?
  • Previous by thread: Re: Requested Xcode Feature
  • Next by thread: Re: Xcode and Java searchpath
  • Index(es):
    • Date
    • Thread