How to export Intellij project as Eclipse archived folder - eclipse

My professor wants all assignments submitted as an archived folder and wants the program to be able to run on his Eclipse when he grades them. The program is a simple one with one folder that has to contain just one class with the main method.
I am using IntelliJ.
I followed Jetbrains faq on exporting files as Eclipse-compatible using Files --> Export : https://www.jetbrains.com/help/idea/exporting-an-intellij-idea-project-to-eclipse.html
It looks like the files were successfully converted as my folder directory looks similar to what the website. A screenshot of my directory after exporting: https://imgur.com/a/qQY4lUH
I am not sure what to do here as I am not familiar with the Eclipse ".classpath" and ".project" files that were created as well as the .eml and .iml files. I don't know what to do with them.
I was thinking of just copying them into a new folder called "ReviewNW" and archiving them and submitting that folder. I don't know if that would be enough for Eclipse to run my program. Is there something else I have to do from here?
Additional question: I have since changed some things in my program. Now when I try to use File --> Export, IntelliJ gives me an error and says I "cannot export files already exported to eclipse-compatible format". What if I make some changes to my class files in my src folder and need to export those changes again? I think I would need to manually delete each of those Eclipse files and export again or is there a simpler way?
Thank you!

Related

Eclipse workspace corrupted after saving as zip

I have a need to share an eclipse workspace as a zip file. However, when I zip the workspace and then unzip it all of the user configuration is lost including the project that was opened in the workspace, what views are showing, and even a JBoss server that was created.
If I copy and paste the workspace everything works fine.
If I zip and unzip all of the configuration is lost (i.e. when I launch Eclipse and use the unzipped workspace Eclipse opens with all of the default settings including the welcome page).
What could be causing this and how do I get the zip to work?
I know there are other ways to export Eclipse configurations but I do have a specific requirement that this be provided as a zip file.
It looks like the problem was with the file names that started with ".". I re-zipped with WinZip instead of the built-in windows tool and everything is working now. See: blog.robertelder.org/zipping-corrupts-eclipse-workspace

Version 8.2 difficulties

I upgraded to version 8.2 and my projects list disappeared. When I pointed to the folder where my java files are located, Netbeans cannot find a project file. However, in the folder reside my 2 java files and a form file.
Admittedly, I do lack a bit of Netbeans experience, and for the life of me, I cannot figure out how to import these files into a project - and be able to work with the form. Can anyone give me a pointer on how to resurrect my project?
Edited at recommendation:
When I selected "Open Project" and entered the path to where my files are located "/Users/robertbray/Documents/Robert/NetBeans/numberaddition/" In the "Project Folder" pane, nothing appears, as if the project does not exist. So, playing around this evening, I used the "Open File" method and entered the path "/Users/robertbray/Documents/Robert/NetBeans/numberaddition", now I am able to see my source files (NumberAdditionUI.java, NumberAdditionUI.form, and GraphPanel2.java) and I can open them, including the form (design). However, I cannot determine how to convert this to a project file so I can build and run the code - these options are greyed out.
Since I had the original source files, I created a new project, then moved (and renamed) the original java class/form files into the "/src" directory. Of course I had to do some changes in the java files with the new name. As s test, I modified the form and rebuilt the project. Working as expected. Many thanks to #skomisa!

Eclipse workspace directory

I want to program in C using Eclipse and I am asked to give a workspace directory when I launch Eclipse. I read that the workspace is where you store your projects. But when I write a .c program and have its .exe file in the same place, I will want to have it in "Documents" or similar and not under C:\users\something. Will all my codes and files be stored there? How should I understand this workspace-directory question?
Sorry, I'm not used to this as I come from Notepad++.
Eclipse's workspace directory is where your projects are stored during development. So your main source code is here, but also all your doco, Eclipse config, test files, executables, etc.
When your project is complete and you are ready to deploy, you can put your executable wherever you want, eg. your "Documents" directory or C:\Program Files.
Responding to your comment, you can also put the source code (.c) wherever you want too. But it would be unusual to deploy source code.

Files disappeared, could be related to Eclipse

I have lost files mysteriously a few times from my Eclipse workspace folder, and previously I assumed that I must have deleted them, but this time I know for sure that I didn't.
I entered a folder for a Java project. I listed the files. There were several text files. I then opened one in gedit to look at it. As far as I remember, I then did something in libreoffice Calc (to a spreadsheet file in a completely separate location), then I made some changes to the Java file in Eclipse. It would then have been automatically compiled. I then went back to the terminal to execute the program, but it wouldn't run. Listing the files shows that the reason it wouldn't run is that all the text files have disappeared and so has one of the .jar files (called stanford-parser.jar) but not another. I've searched my computer for these files and I can confirm they've gone.
A screenshot from my terminal illustrates this.
Can anyone help me to understand how this is happened, so I can avoid it happening again? Could compilation delete the files?
You seem to be storing source files in the bin directory of your Eclipse project, which is probably the target directory used by Eclipse to put the compiled classes. Store your sources in the source folder. The target folder is completeley deleted by Eclipse each time the project is cleaned up.
Note that non .java files stored in the source directory are automatically copied to the target directory by Eclipse. They're considered as resources that must be available at runtime in the compiled application.

How to have different file links to an Eclipse project (not importing it)?

I noticed when I import a file, the file is copied to the work space, but can I just create a file link in a Eclipse project? So when I modify the files in Eclipse, the files in the linked location is modified. In this way, I can version control the files using SVN. And I don't need to copy the modified files back to its dedicated directory when deployment.
The following is a more detailed description of my problem:
I have a cgi application located and runs in apache. The app runs with diff configuration files for different 'projects' which is more like showing different dataset with its corresponding configuration file. My task is to write the configurations files which will require some perl callback functions, css files and images. All these files have their own dedicated directories located in different places in the company server which i have not much control with.. So far, I just use command line to modify files and keeping old copies for version control. If I can do something like my above description, I will be able to have a central place to work on and do SVN. Or do you have a better idea how I should set up my work environment?
Thanks heaps in advance.
Yes you can,
File -> New File -> Advanced (at the bottom) -> Link to file in the file system
Manu
I have figured out a way to conveniently to version control files from different places and can deploy them to the correct directories after modified. It's ....... using..... the ANT build file... I just have all files imported to a single project and use an ANT build to distribute them back to their corresponding destination.
Use svn:external http://svnbook.red-bean.com/en/1.0/ch07s03.html
One drawback though, you have to update your other projects once you commit a shared files.