project layout [message #67484] |
Wed, 25 June 2003 19:18 |
Eclipse User |
|
|
|
Originally posted by: greg.ferguson.americawest.com
Hi,
I need some pointers/advice/links on how to get Eclipse to successfully
generate a .jar using one .java file and Oracle's JDBC.
I have Oracle's jdbc.jar (actually called "ojdbc14.jar") in my /lib
directory. The project is pointing to that file and including it in both
the "Libraries" and "Order and Export" tabs.
I've tried moving Oracle's jdbc.jar to the root of the project, but that
made no difference when creating the emax.jar.
( http://www.eclipse.org/newsportal/article.php3?id=361&gr oup=eclipse.tools.jdt)
I still get the following message when I try to run the .jar ...
> java -jar Emax.jar com.awa.awt.emax.Emax
Can't register the JDBC class "oracle.jdbc.driver.OracleDriver"
[oracle.jdbc.driver.OracleDriver]
If I compile and build the .jar in JDeveloper 9.0.3.1, using the same
project layout, source and jdbc.jar, I'll get a substantially larger
output .jar file (2,820,661 bytes vs. 1,181,971 bytes). This jar created
by JDeveloper will run without problems.
The project is laid out on the disk like so: (based on the root of my
project)
/src/com/awa/awt/emax/emax.java
/lib/ojdbc14.jar
My .project is:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>emax</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
My .classpath is:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="var" path="JRE_LIB"
sourcepath="JRE_SRC"/>
<classpathentry exported="true" kind="lib" path="lib/ojdbc14.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
My manifest is:
Manifest-Version: 1.0
Main-Class: com.awa.awt.emax.Emax
My jar description is:
<?xml version="1.0" encoding="UTF-8"?>
<jardesc>
<jar path="C:/Program Files/eclipse/workspace/emax/Emax.jar"/>
<options overwrite="true" compress="false" exportErrors="false"
exportWarnings="true" saveDescription="true"
descriptionLocation="/emax/emax.jardesc"
useSourceFolders="false" buildIfNeeded="true"/>
<manifest manifestVersion="1.0" usesManifest="true"
reuseManifest="false" saveManifest="true"
generateManifest="true" manifestLocation="/emax/emax.manifest"
mainClassHandleIdentifier="=emax/src<com.awa.awt.emax{Emax.java[Emax ">
<sealing sealJar="false">
<packagesToSeal/>
<packagesToUnSeal/>
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="false">
<javaElement handleIdentifier="=emax/src"/>
<folder path="/emax/lib"/>
</selectedElements>
</jardesc>
If anyone can point me to what might be wrong I'd appreciate it. I think
Eclipse rocks.
Thanks,
Greg
|
|
|
Re: project layout [message #70665 is a reply to message #67484] |
Tue, 01 July 2003 03:36 |
Eclipse User |
|
|
|
Originally posted by: greg.ferguson.americawest.com
Just in case someone's wondering ...
I figured out the problem.
Eclipse needs to have the jdbc .jar imported into /lib, and then the class
folder added to the build path.
It's playing nice now.
Greg Ferguson wrote:
> Hi,
> I need some pointers/advice/links on how to get Eclipse to successfully
> generate a .jar using one .java file and Oracle's JDBC.
> I have Oracle's jdbc.jar (actually called "ojdbc14.jar") in my /lib
> directory. The project is pointing to that file and including it in both
> the "Libraries" and "Order and Export" tabs.
> I've tried moving Oracle's jdbc.jar to the root of the project, but that
> made no difference when creating the emax.jar.
>
( http://www.eclipse.org/newsportal/article.php3?id=361&gr oup=eclipse.tools.jdt)
> I still get the following message when I try to run the .jar ...
> > java -jar Emax.jar com.awa.awt.emax.Emax
> Can't register the JDBC class "oracle.jdbc.driver.OracleDriver"
> [oracle.jdbc.driver.OracleDriver]
> If I compile and build the .jar in JDeveloper 9.0.3.1, using the same
> project layout, source and jdbc.jar, I'll get a substantially larger
> output .jar file (2,820,661 bytes vs. 1,181,971 bytes). This jar created
> by JDeveloper will run without problems.
> The project is laid out on the disk like so: (based on the root of my
> project)
> /src/com/awa/awt/emax/emax.java
> /lib/ojdbc14.jar
> My .project is:
> <?xml version="1.0" encoding="UTF-8"?>
> <projectDescription>
> <name>emax</name>
> <comment></comment>
> <projects>
> </projects>
> <buildSpec>
> <buildCommand>
> <name>org.eclipse.jdt.core.javabuilder</name>
> <arguments>
> </arguments>
> </buildCommand>
> </buildSpec>
> <natures>
> <nature>org.eclipse.jdt.core.javanature</nature>
> </natures>
> </projectDescription>
> My .classpath is:
> <?xml version="1.0" encoding="UTF-8"?>
> <classpath>
> <classpathentry kind="src" path="src"/>
> <classpathentry exported="true" kind="var" path="JRE_LIB"
> sourcepath="JRE_SRC"/>
> <classpathentry exported="true" kind="lib" path="lib/ojdbc14.jar"/>
> <classpathentry kind="output" path="bin"/>
> </classpath>
> My manifest is:
> Manifest-Version: 1.0
> Main-Class: com.awa.awt.emax.Emax
> My jar description is:
> <?xml version="1.0" encoding="UTF-8"?>
> <jardesc>
> <jar path="C:/Program Files/eclipse/workspace/emax/Emax.jar"/>
> <options overwrite="true" compress="false" exportErrors="false"
> exportWarnings="true" saveDescription="true"
> descriptionLocation="/emax/emax.jardesc"
> useSourceFolders="false" buildIfNeeded="true"/>
> <manifest manifestVersion="1.0" usesManifest="true"
> reuseManifest="false" saveManifest="true"
> generateManifest="true" manifestLocation="/emax/emax.manifest"
> mainClassHandleIdentifier="=emax/src<com.awa.awt.emax{Emax.java[Emax ">
> <sealing sealJar="false">
> <packagesToSeal/>
> <packagesToUnSeal/>
> </sealing>
> </manifest>
> <selectedElements exportClassFiles="true" exportJavaFiles="false">
> <javaElement handleIdentifier="=emax/src"/>
> <folder path="/emax/lib"/>
> </selectedElements>
> </jardesc>
> If anyone can point me to what might be wrong I'd appreciate it. I think
> Eclipse rocks.
> Thanks,
> Greg
|
|
|
Powered by
FUDForum. Page generated in 0.03241 seconds