CVS cannot download project to a specified directory - java

I'm trying to checkout a project from my local cvs repository to a location. Why is this giving this error? Am i not using the options properly?
ne#ne3:~/JarTester$ cvs -d:pserver:uname#localhost:/home/uname/cvsrepo/ co -P MavenTestApp /home/ne
cvs [server aborted]: Absolute module reference invalid: `/home/ne'
cvs [checkout aborted]: end of file from server (consult above messages if any)
I can use cd but i have to run it in java. So cd is not in consideration.
Thank You

If this is your first cvs checkout, create a folder in Windows Explorer to hold all of your cvs project folders. Then create a subfolder for this project. (You may even want to create separate subfolders for each module if you're working in more than one.)
In Cvs, select Cvs Admin - Login and enter your cvs password.
Click on the left window in the program and select a folder. Then select Cvs Admin - Checkout Module. Select the project folder you created earlier.
Enter the project module name and click OK. You should see a scrolling list of filenames as these are created in your folder(s).
Repeat the module creation process for each additional cvs module you wish to check out.

Related

Intellij Tree with custom files in plugin

I'm developing intellij plugin and I have tree structure with files and directories (not related to current project nor file systems). Is is just some virtual tree structure provided by rest service. I want to display it in ToolWindow with all common staff like colors, file type icons etc.
Is my usecase already supported by intellij?
Which classs support this?
The closes one related to my case I found trees from vcs package but it is commit / change related.
I don't think what you want to do is formally supported by JetBrains, but you could create a "fake" project in Intellij IDEA as long as the files and directories you want to appear in the tools (Project) window have a single parent directory.
I had a folder named "docs2" which contained some random notes and documentation files of various types such as txt, pdf, zip, html, js and bak. I opened that directory as a project in Intellij IDEA's Project window as follows:
Create an new project: File -> New -> Project... -> Static Web -> Static Web, then click the Next button:
On the next screen populate the Project location field by navigating to the folder containing the files you want to open in Itellij IDEA, and give the project a suitable name. Then click Finish.
After that Intellij IDEA will treat the directory as though it was a static web project.
Notes:
Intellij IDEA won't necessarily be able to handle all of the project files created in this manner. For example, when I opened a pdf file it was opened in another application, and when I tried to open a zip file nothing happened. But other known file types such as *.txt, *.html and *.js can be opened and edited as though they were files in a "real" project.
When you open the directory as a project Intellij IDEA will create some files in that directory: a *.iml project file and a .idea folder containing configuration files, so you will need write access to the folder that you open as a project.
I also tried opening the directory as an Empty Project in Intellij IDEA, but that only worked partially; files under the parent directory were shown, but for some reason it would not show any sub-directories in the project.

How to attach source in Eclipse project for lib with no "sources JAR"?

I'm aware that this answer is a generally-accepted method for attaching sources for 3rd party JARs in Eclipse. However, I'm following the instructions and they're not working for me.
I'm trying to attach the source for JASIG CAS (version 4.0.0, so the CAS-4.0.0 link). When you download and extract this ZIP, it has the following directory structure:
cas-server-4.0.0/
cas-management-webapp/
...lots of source files
cas-server-core/
src/
main/java/
...lots of Java sources --> these are the .java files I want to attach as source
site/
test/
pom.xml
...lots of other dirs that start "cas-server-*"
So the CAS project consists of a bunch of JARs; the main one being cas-server-core. I want to attach the Java source for this JAR only. However, there is no compiled cas-server-core-source.jar here, just the exploded source files.
I'm looking for the exact instructions for attaching these sources so that when I run a debugging session in Eclipse, the debugger can find the sources and jump into them.
So far, I've tried:
Right-click my project >> Properties >> Java Build Path >> Libraries >> Add External JARs
I then selected the cas-server-4.0.0-release.zip. Then:
Under cas-server-4.0.0-release.zip Library, Select "Source attachment" >> Edit >> External location >> select the location of the cas-server-core/src directory
This isn't working. I'm wondering, do I need to first compile a cas-server-core-source.jar? If so, what does the directory structure of that JAR need to be.
In any event, how do I actually go about attaching the source for this JAR?
I just tried it in my workspace and was able to resolve the source files properly. The trick is that when you select the external location, you should pick the 'external Folder' instead of 'External File'.
I selected the External Folder with path cas-server-4.0.0/cas-server-core/src and it worked.

How to import a single file from CVS into project

I'm trying to copy a single file from CVS into a new project that I created, but when you right click on the file in CVS it doens't have the option to check the file out. If I right click on a folder in CVS however, I can check out an entire folder to my project. How can I copy just a single file?
The folder-level "Check Out" action establishes linkage between the content of a local folder and the repository. You can then work in connected mode with change tracking etc. CVS tracks this linkage at folder level. It doesn't support single-file linkage.
Perhaps you don't care about this linkage and just want to retrieve a file from the repository. To do that, double-click on the file in the CVS Repositories view. Once the file opens in an editor, save it wherever you'd like.
cvs co <your_project>/path/to/file_you_are_interested_in

How to create a project from existing source in Eclipse and then find it?

I have created several .java files. All of them are located in one directory. I used a text editor to write these files. Now I want to switch to Eclipse. How can I do it? I have tried many ways. None of them works.
ADDED:
I think the common way is to have source in the eclipse folder called "workspace". So, how do I get my files in these directory. Should I use eclipse to create a new project from existing source and Eclipse will put all file to the workspace? Or I should manually copy all my files to the workspace? Where should I put my class files than? Should I create a subdirectory? With which name?
ADDED 2:
When I try to create a project with name "game", the eclipse writes me that a project with such name already exist. But how can I open this project?
ADDED 3:
In my "workspace" I have created a subdirectory called "game". I copied all my .java file into this subdirectory. Then with Eclipse I created a new project with the name game. As a result, Eclipse created .classpath and .project files in the directory "game". It also created bin and src subdirectories. And now I think it is not the correct way to go. The source files are supposed to be in the "src" directory. Right? And at the moment all my .java files are in the "workspace\game".
ADDED 4:
I did it other way around. With Eclipse I have created a new project with the name "game". As the result, Eclipse created a folder called "game" into folder "workspace". In "game" the folder I found "src" folder. I copied all my .java files into this folder. But now in the "Package Explorer" I cannot open "src" folder. So, how can I access my source files from Eclipse? Why Eclipse does not want to open the "src" folder?
Easiest Method:
Put all source files into one directory named after your project. i.e. "ProjectName" You can keep this directory in your workspace or it can be somewhere else.
Start a new project in eclipse and name it using that same project name.
Uncheck the "use default location" box and find the directory where your project is unless your project is already in the workspace - then you must not uncheck the "use default location" box
Click 'next'.
Eclipse should be smart enough to figure out what's going on. After clicking next, it will show you all of the files it found in that directory. It will just automatically add those files to your project. VoilĂ !
Right-click in the package explorer and select New - Java Project
Create the new project Game
Open the new project in the package explorer - you should see only the source folder called src (there's nothing inside yet)
Open a file Explorer (e.g. Windows Explorer) and drag your sources
Drag them to Eclipse and drop them inside the new src folder - if asked select "Copy files"
Eclipse should put the files into the default package, if that's not correct you can edit the offending files (marked with a red cross) by opening them in Eclipse, selecting the package declaration (usually line 1), pressing Ctrl + 1 and selecting the appropriate option (e.g. "Move xy to package com.game"
This answer is going to be for the question
How to create a new eclipse project and add a folder or a new package into the project,
or how to build a new project for existing java files.
Create a new project from the menu
File->New-> Java Project
If you are going to add a new pakcage, then create the same package name here by
File->New-> Package
Click the name of the package in project navigator, and right click, and import...
Import->General->File system (choose your file or package)
this worked for me I hope it helps others.
Thank you.
The easiest method is really good but you don't get a standard Java project, i.e., the .java and .class files separated in different folders.
To get this very easily:
Create a folder called "ProjectName" on the workspace of Eclipse.
Copy or move your folder with the .java files to the "ProjectName" folder.
Create a new Java Project called "ProjectName" (with the Use default location marked).
Press <Enter> and that's it.
There are two things
1- If its already a Eclipse Project, then simply go to File->Import->General->Existing Project into Workplace
2- Otherwise define project type e.g. Java, Web etc
Create a new project of type you define into your workplace. Copy Paste source , lib and other necessary files. refresh, compile and run project in eclipse.
In the package explorer and the navigation screen you should now see the project you created. Note that eclipse will not copy your files, it will just allow you to use the existing source and edit it from eclipse.
There are several ways to add files to an existing Java project in Eclipse. So lets assume you have already created the Java project in Eclipse (e.g. using File -> New -> Project... - and select Java project).
To get Java files into the new project you can do any of the following. Note that there are other ways as well. The sequence is my preference.
Drag the files into the Navigator view directly from the native file manager. You must create any needed Java packages first. This method is best for a few files in an existing Java package.
Use File -> Import... - select File System. Here you can then select exactly which files to import into the new project and in which Java package to put them. This is extremely handy if you want to import many files or there are multiple Java packages.
Copy the fires directly to the folder/directory in the workspace and then use File -> Refresh to refresh the Eclipse view of the native system. Remember to select the new project before the refresh.
The last one is what you did - minus the refresh...
While creating a project from a full folder may or may not work within the workspace, there's a condition outside of the workspace that prevents starting a new project with a full folder.
This is relevant if you use numerous folder locations for sources, for example an htdocs or www folder for web projects, and a different location for desktop Java applications.
The condition mentioned occurs when Eclipse is told to create a new project, and given a full folder outside the workspace. Eclipse will say the folder isn't empty, and prevent creating a new project within the given folder. I haven't found a way around this, and any solution requires extra steps.
My favorite solution is as follows
Rename the full folder with an appended "Original" or "Backup.
Create the Eclipse project with the name of the full folder before the folder was renamed.
Copy all the relabeled full folders contents into the new project folder.
Eclipse should make a new project, and update that project with the new folder contents as it scans for changes. The existing sources are now part of the new project.
Although you had to perform three extra steps, you now have a backup with the original sources available, and are also able to use a copy of them in an existing project. If storage space is a concern, simply move/cut the source rather than fully copy the original folder contents.
If you creating a new project based on an existing Maven structure :
Create the project using a general project wizard and give the project the same name as just created.
If you try to create the project as a Maven project via m2e will receive an error that project/pom already exists.
Create a new project..
Right Click on your project..
Select Build path --> Configure Build Path
Under source tab choose link source, your .java files containing folder..
I am suggesting this since none of the methods that you tried have worked ---FYI
Follow this instructions from standard eclipse docs.
From the main menu bar, select command link File > Import.... The Import wizard opens.
Select General > Existing Project into Workspace and click Next.
Choose either Select root directory or Select archive file and click the associated Browse to locate the directory or file containing the projects.
Under Projects select the project or projects which you would like to import.
Click Finish to start the import.

How do I save Eclipse launch profiles across workspaces?

When I copy an Eclipse project directory, it contains the .classpath and .project files so that when I take that same directory to another Eclipse instance, I don't have to setup my build path and such (assuming that all the resources are contained in the project, and not external.)
However, this procedure doesn't cause launch profiles to "travel" with the directory.
Is there some other file/directory structure I can "carry around" to another instance of Eclipse that will include my launch profiles?
The .launch xml files (launcher definition) are found in
[eclipse-workspace]\.metadata\.plugins\org.eclipse.debug.core\.launches
Just copy them into your <project>/.settings directory.
Refresh your project, and there you have it: those launcher configuration are available, and you can copy them along the rest of your project files.
Warning: do uncheck the option "Delete configurations when associated resource is deleted" in the Run/Launching/Launch Configuration preference panel: it is common ot soft-delete a project in order to import it back again, to force a reinitialization of the eclipse metadata,... but this option, if checked, will removed your detailed launch parameters!
See also Which eclipse files belong under Version Control, and where are the external tools launch configurations in Eclipse.
Jared adds:
There is no .settings directory in my project directory - I created it and put the .launch file in there, refreshed my project, and it doesn't have any Run profiles. Do you have to mirror the directory structure under .metadata?
Just create the .settings directory (it is actually created when you have project specific settings as illustrated in the question "Maintaining a common set of Eclipse preferences").
Then delete the same .launch file from the .metadata directory.
Then refresh your project and go to the "Run Configurations" Panel: you will see your launch configurations still available, except they are stored where they belong: within your project directory and not buried under an obscure workspace metadata thingy.
Update June 2012
I always seen my launch configurations, saved under PROJECT_LOC/.settings, automatically imported when reloading the Eclipse workspace.
However, as described in "Tip: Creating and Sharing Launch Configurations (2007)", you should be able to reference a launch configuration saved into any subdirectory of your project if you go to the "Common" tab of your "Run Configurations" wizard.
So saving your launcher anywhere in the project won't display them automatically in the "Run Configurations" section of the preferences.
But declaring a new one, sharing its launcher as a "Shared file" (as illustrated above), and then overwriting that launcher with the actual one you had previously saved would update that run configuration.
Try choosing a shared file location inside your workspace from the "Common" tab of the launch configurations (profiles).
Depending on the amount of moving around you do and the number locations you move to, storing your launch files in an online storage space and then setting up folders at the new locations to synchronize with it may be a viable solution.
Dropbox
is a decent online storage system that gives users up to 2 gigabytes of storage.
Here is an example of how you can synchronize folders out side the Dropbox folder curtiousy of
LifeHacker.com :
Use either the JUNCTION utility from Sysinternals, or the MKLINK command built in to Windows Vista and Server 2008, for example:
junction "C:\Documents and Settings\User\My Documents\My Dropbox\DesiredFolder" "C:\Path\To\DesiredFolder"
mklink /D "C:\Users\Steve\Documents\Dropbox\DesiredFolder" "C:\Path\To\DesiredFolder"
Or, if you prefer a GUI, install Link Shell Extension.
[eclipse-workspace].metadata.plugins\org.eclipse.debug.core.launches
would be the DesiredFolder.
You could also use SyncToy to echo changes from another folder to your Dropbox folder. This keeps 2 copies on disk though.
On OS X or Linux, try the following:
Use the ln command, for example:
ln -s /path/to/desired-folder ~/Dropbox/desired-folder
This works with files too:
ln -s /path/to/desired-file ~/Dropbox/desired-file
Another easy way to do this with Terminal is type the ln -s part, then from Finder drag the folder/file that you want into the Terminal window then drag the Dropbox folder and hit return.
Note that an Alias file or folder does not work.
Another solution could be to keep your launch files in an svn repository. Search for How to run Eclipse launch configurations programmatically? on this site. Sorry can only post one url so I used it on Dropbox.
There is an another clean way to share the launch configurations in Eclipse.
Create a java project. For instance lets name it Launches-Configs.
Now create a new Run Configuration for a project that you need to
run.
On the Run Configurations window navigate to Common tab. Ensure
Shared File option is selected and input the Shared File location is set to
\Launches-Configs\src
Check in Launches-Configs to a VCS and share with other teams
I have had good use of creating a /launch folder, and then setting the launch configuration to be "Shared file:" (the Commons panel) to the above mentioned launch folder.
The resulting launch file can be checked into e.g. CVS git and be pulled into a fresh workspace.
Create a Launch Configuration with Shared File option selected under Common Tab.
This will create a configuration file with .launch extension.
Now in another workspace just go to Import and select Launch Configurations, choose the configurations from the directory and finish.
It will appear in the Run configuration now.

Categories