Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Help with Eclipse and perforce?(Trying to add eclipse project to perforce)
Help with Eclipse and perforce? [message #1041012] Sun, 14 April 2013 13:25 Go to next message
Michael Robson is currently offline Michael RobsonFriend
Messages: 5
Registered: April 2013
Junior Member
I have been trying for the best of a week but I can't seem to get a project added to Eclipse that then runs on another computer which gets it from perforce. Please can someone help or point me in the right direction?

I created a new workspace in Eclipse and added some external jars, do I need these in perforce or do the other users just copy them on their computer and update the build path?

The jars are updated often but have a name including the version name e.g. helper3.21.jar, if I renamed it to helper.jar would it still work? that way I could have them in perforce and just submit them each time a newer version came out with the same name.

Once I have my project in eclipse I used the team menu and added it to perforce but when I checked it out on another computer I couldn't get it to run as it said there were no previous launches. I created a launch config and checked that in but then I was getting a workspace name error.

Does everyone who checks it out need to make a workspace with the same name?

Can some one guide me step by step to set up a project check everything needed into perforce and get it running on another computer?

Thank you for any help.
Re: Help with Eclipse and perforce? [message #1041781 is a reply to message #1041012] Mon, 15 April 2013 15:08 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 4/14/2013 7:25 AM, Michael Robson wrote:
> I have been trying for the best of a week but I can't seem to get a
> project added to Eclipse that then runs on another computer which gets
> it from perforce. Please can someone help or point me in the right
> direction?
>
> I created a new workspace in Eclipse and added some external jars, do I
> need these in perforce or do the other users just copy them on their
> computer and update the build path?
>
> The jars are updated often but have a name including the version name
> e.g. helper3.21.jar, if I renamed it to helper.jar would it still work?
> that way I could have them in perforce and just submit them each time a
> newer version came out with the same name.
>
> Once I have my project in eclipse I used the team menu and added it to
> perforce but when I checked it out on another computer I couldn't get it
> to run as it said there were no previous launches. I created a launch
> config and checked that in but then I was getting a workspace name error.
>
> Does everyone who checks it out need to make a workspace with the same
> name?
>
> Can some one guide me step by step to set up a project check everything
> needed into perforce and get it running on another computer?
>
> Thank you for any help.

I use Perforce and I use Eclipse. I use Perforce from the command line.
You do not have to integrate Perforce and Eclipse to get work done. In
fact, I think that integration slows things down. These separate
arrangements work just fine, but it's just my opinion and I won't write
a diatribe on why I don't like Perforce-Eclipse integration. Just
realize that it's not essential to getting work done.

I also have the same opinion about Git-Eclipse integration. (I use Git
much more than Perforce anymore, but I'm right now working on a project
that requires Perforce again.) One or two of my colleagues use eGit, but
as I watch them, it's very slow and painful as compared to the command
line. Of course, I am a command-line sort of guy too.

Sorry I'm not answering the question you're asking, but these comments
come under the "any" part of "any help" you asked for.

Best of luck.
Re: Help with Eclipse and perforce? [message #1042269 is a reply to message #1041781] Tue, 16 April 2013 07:45 Go to previous messageGo to next message
Michael Robson is currently offline Michael RobsonFriend
Messages: 5
Registered: April 2013
Junior Member
Thank you for the reply. Would you be able to offer any help with getting the java project working on another machine? For example when you use the command line to check stuff in to perforce if you then go to another computer and open the project I assume it works but I just get a message about the workspace names not matching.

Re: Help with Eclipse and perforce? [message #1042530 is a reply to message #1042269] Tue, 16 April 2013 14:33 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 4/16/2013 1:45 AM, Michael Robson wrote:
> Thank you for the reply. Would you be able to offer any help with
> getting the java project working on another machine? For example when
> you use the command line to check stuff in to perforce if you then go to
> another computer and open the project I assume it works but I just get a
> message about the workspace names not matching.

Sure, if I can.

Consider the following:

1. Eclipse workspaces aren't portable or sharable, only projects are.
Don't commit (p4 add/submit), for example, the workspace subdirectory or
its .meta subdirectory thinking there's anything to be gained by it.
Also in the workspace will be a Server subdirectory if you're doing web
development. Don't try to store that in Perforce.

2. Do commit .project, .classpath (both files) and .settings (a
subdirectory).

3. Take care how you structure the addition of third-party libraries.
Make sure you add them with Java Build Path as an in-project navigation.
Don't go outside the project for them or for source or Javadoc you add
to them. This ensures that .classpath will not contain any host-specific
paths. If you're cloudy on this point, the following comments, though
made for Git, are relevant:

http://www.javahotchocolate.com/tutorials/git-eclipse.html

4. A colleague of mine always manages two separate Perforce client
specifications so that he can do a p4 sync separately to try out what
he's done in order to know when he's broken it. I personally have never
broken the build in two years running, so I don't know what there is to
be gained from this, but he swears by the practice. I don't know how he
does this exactly, but if you e-mail me directly, at r u s s @ w i n d o
f k e l t i a . c o m, I'll send you some notes I have kept on the topic
against the case that it does become needful.

5. If the project is submitted completely and accurately to Perforce,
then a new engineer should be able to

a. p4 client
b. p4 sync
c. Launch Eclipse with a suitable workspace
d. Import the project into his workspace; to do this:
i. File -> Import -> General -> Existing Projects into Workspace
ii. Next
iii. Navigate to the parent of the subdirectory that is the
root of the project in your filesystem (filesystem under Perforce control)
iv. Select that project and click OK.
v. Don't opt to bring that project's files and directories into
the Eclipse workspace; leave it where it is, where Perforce will be
managing it and where you'll issue Perforce commands (or just use p4v).
e. If doing web development, create a Server (I can help with this,
but it's off-topic).

When I say command line, note that you can also use p4v if you like. I
rarely do, but sometimes I do when I want to explore the rather
humongous amount of code there is--only a tiny part of which I actually
have to work on.

Incidentally, these concerns are the same for Git (if you ever graduate
beyond wanting to pay the exorbitant fees for Perforce and want free and
much simpler and more performant version-control software).

Hope this helps.

Russ
Previous Topic:BPMN1 and BPMN2
Next Topic:Android debug view/perspective gone
Goto Forum:
  


Current Time: Fri Apr 26 08:14:16 GMT 2024

Powered by FUDForum. Page generated in 0.09144 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top