 |
 |
Importing a Java project into PB
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Location: Portland, OR
Status:
Offline
|
|
Be gentle, I am more of a sysadmin than a programmer, and a relative newbie to Java..
I have recently inherited maintenance of a build tool which is written in Java. What I have is a .jar file that contains all the .classes as well as a directory with the source in it. There are also a bunch of .classes for stuff like Oracle, etc. The application executes just fine on my Powerbook.
The previous people who worked on this tool are no longer with the company. I believe the IDE they were using was JBuilder but I don't think we own that software anymore (long story..)
I have the Dec 02 development tools, and I would like to import the code into a Project Builder project so I can easily edit the source and make new jar files on an ongoing basis. Whats the best way of accomplishing this?
I tried making a blank project and copying source files in, but when I made a new target I couldn't figure out how to get the source files to be associated with the target. Is the easiest way to create a new "java tool" project, and copy the code into that?
Thanks in advance.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status:
Offline
|
|
The first thing I would do is create an Ant makefile that can build jars from source without any IDE.
Next, I would worry about getting the IDE to integrate with Ant (very likely, except of course for PB). Many IDE's like Sun One can kick off the ant scripts in the IDE.
Anyway, I actually don't ever use an IDE on OS X, I just use Ant for building and PB for editing (the files are opened from the command-line using 'open'.
I too had bad luck trying to get non-trivial applications to work in PB and eventually gave up.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
To get the source files to be associated with the target: select the target as the Current Target, and click the checkboxes in the Files pane next to the source files you want to be part of that target.
|
|
[vash:~] banana% killall killall
Terminated
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Location: Portland, OR
Status:
Offline
|
|
Originally posted by Gul Banana:
To get the source files to be associated with the target: select the target as the Current Target, and click the checkboxes in the Files pane next to the source files you want to be part of that target.
Ok, this actually worked, sort of. Now I am getting a bunch of
package javax.servlet does not exist
package javax.servlet.http does not exist
package oracle.jdbc.driver does not exist
package javax.mail does not exist
<etc>
when I try to compile, most of them are things that contained .class files in the .jar file I extracted. I tried just adding those .class files into the target, but that didn't help.
I have had a class in the Java language, but we didn't go over stuff like packages. Can anyone recommend a good book, or PDF/online reference that would explain how java imports work, and where I might get the classes I need?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by geekwagon:
Ok, this actually worked, sort of. Now I am getting a bunch of
package javax.servlet does not exist
package javax.servlet.http does not exist
package oracle.jdbc.driver does not exist
package javax.mail does not exist
<etc>
Sounds like you need two things. First, you need the Servlet libraries, and second, the Oracle JDBC (database) driver.
For the servlet stuff, download Tomcat ( http://jakarta.apache.org/). For the Oracle JDBC driver, get it here: http://otn.oracle.com/software/tech/...c/content.html
You will need to add them to your classpath for them to be available.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Location: Portland, OR
Status:
Offline
|
|
Thanks guys, this pretty much got me going. I am probably going to have to look at using Ant as a previous poster had suggested as this seems to be more complex than PB is able to easily handle. For instance, I can't seem to get the classpath to work with a directory full of classes, I have to make them into a jar. Not sure if that is normal or not, but there are a few oddball classes in this project that I haven't been able to track the packages they came out of down. It seems to get them if I put the .jar file that I originally started with to get the source into my classpath for the target.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2001
Location: Umbrella Research Center
Status:
Offline
|
|
ant is one of the best developement tools out there...
for help setting it up see cs.indiana.edu/classes/c343/resources.html
yep
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|