I'm working with intellij idea but I can't see the java source files in the project tree. I see the packages, I can open it, but the class files are not displayed. Any idea? This has worked until a few days ago...
Under the intelliJ IDEA 14.0.3 community edition, upon launch I don't see my project folders. I found by going into
View > Tool Windows > Project
seems to show the folder structure.. Same as ALT + 1
Below the menubar , on the left there is a dropdown which in your case may be showing "packages" now (because you can see the packages). From the same dropdown, select "Project Files" below "SCOPES"
You need to check out the project correctly if you are checking out from SVN repo or you must not have selected correct project folder.
You can also configure your project from File->Project Structure check your Source folder is excluded or not.
Also Alt+1 will give you project structure of files in tree format
Check in "Project Structure" (ctrl+alt+shift+S) if you didn't set your source as "Excluded" (in Modules, sources).
If you are develop a maven project, you could run mvn idea:idea and then open the project in your Intellij, the source files and the project tree would become the shape you like.
I want to get, when i press the little green "run me" button in intelliJ, the running program to pick up and use this file (in the project structure)
/src/config/some_folder/some_xml.xml
However, when i press that green run button, intelliJ 12 is giving me this error:
Resource not found on classpath using context ClassLoader: some_folder/some_xml.xml
In an attempt to resolve, this, I have this in my Settings:Compiler: Resource patterns
!?*.java;!?*.form;!?*.class;!?*.groovy;!?*.scala;!?*.flex;!?*.kt;!?*.cl;?*.xml;?*.config
note the penultimate xml entry.
I also unchecked the "use external build" button. I do not know what it means or does, but I read somewhere that it should not be used.
I also have these (among other entries) in Project Structure:Modules: Sources tab
config
config\some_folder
Marked in blue (sources) under the Source Folders heading.
There is no fancy pom.xml for this project - it is an old legacy project. If i add a pom.xml to resolve this, where would i put it, what would i put in it (in entirety) and would i need to tell intelliJ i now have a pom.xml?
EDIT ok, so intelliJ can find the file when i refer to it as
./config/some_folder/some_xml.xml
but will not find it if it is reffered to as
some_folder/some_xml.xml
I think this is the real issue - how do i resolve this?
src/config needs to be configured in the project as a resources folder. In the project tray, right click /src/config and select "Mark Directory As" -> "Source Root"
I build in maven multiple projects (let's name them A,B,C). Project A uses .jar of project B which uses .jar of project C.
I am modifying the code of all A/B/C projects, (A is MVC app, B are business services and C is some shared layer).
The thing is, in Eclipse/NetBeans I can see all of them at once and it's comfortable to modify them. In IDEA though, I have to open 3 instances (or n instances) of IntelliJ IDEA.
Am I missing something? Is there better approach when using IntelliJ? This is the biggest downside of IntelliJ for me atm.
I think this has improved with recent versions of IntelliJ. In my current version (12.0.2), you can add any number of separate Maven projects to the same "workspace".
The simplest way I've found to do this is to click the little + icon in the "Maven Projects" window (View > Tool Windows > Maven Projects) and then select the additional pom file you want to import.
Step 1: open "Maven Projects"
Step 2: select the project you want to import:
Prequisite
Having all the related projects in the same root directory
can be helpful.
Steps
1) First you create a new Empty project
2) Then you select the root directory of all your projects.
This will create a empty project, with a .idea directory that will simply remember the module organisation we are about to do in the next step
3) Then, in the next window, you import the different projects as modules
4) In the next window, to import each project, simply double click on the build.gradle, or pom.xml
The project will be imported as a new module.
5) Done, you now have all your projects as modules, opened on the same IntelliJ project
Yes, your intuition was good. You shouldn't use three instances of intellij. You can open one Project and add other 'parts' of application as Modules. Add them via project browser, default hotkey is alt+1
In IntelliJ 14.1.2, I did it like following:
Select File->Project Structure->Modules.
Select + and Import Module and select the directory of your project(or directory where pom exists) and click OK.
Follow through the next flow of screens and after you click Finish, you should see the project alongside your existing one.
None of the solutions worked for me, since I am not working on Maven projects. There is a simpler solution. Go to:
File->Project Structure->Modules.
Instead of adding module, simply click the third option (copy). Browse your local directory and select the project you would like to add. Module name will resolve automatically. That's it.
Update: When you want to reopen to project with multiple sub-projects, in order to avoid re-doing steps as described above, just go to
File->Open Recent->'Your Big Project'.
Since macOS Big Sur and IntelliJ IDEA 2020.3.2 you can use "open projects in tabs on macOS Big Sur" feature. To use it, you have to enable this feature in your system settings:
System Preferences -> General -> Prefer tabs [always] when opening documents
After this step, when you will try to open second project in IntelliJ, choose New Window (yes, New Window, not This Window).
It should result with opening new project in same window, but in the new card:
To expand #Neo answer:
after choosing your directory. select import module from external model and choose your model (maven in this case).
Then check keep project files option from next dialog. It will keep all files in original directory.
Your final project structure would be something like this.
Now you can add your module as dependency to other module's pom.xml and if you change the source code of your dependencies, Intellij takes care of updating your project (there is no need to run mvn build manually for dependencies)
new empty project
File -> New -> Module from Existing Sources
For who uses Gradle can also avail the same:
Go to:
1. View --> Tool Windows --> Gradle
2. Click on the + button and add your build.gradle file
Open preference -> appearance & behaviour -> System settings -> select (open project in new window) then apply.
Then you could open and edit multiple projects.
You can use Armory plugin which makes switching between projects comfortable. The default shortcut for Project List is Alt + A.
By default currently opened projects are displayed at the top of this list (with bold style).
Use the button for the add maven projects and go inside the folder of the project. Then, select the pom.xml file and add them in the IntelliJ.
Press "F4" on windows which will open up "Project Structure" and then click "+" icon or "Alt + Insert" to select a new project to be imported; then click OK button...
To Intellij IDEA 2019.2, F4 + click on module, click to + for add any project from your HDD, above this menu yo can edit the IDE with you create the project and more options, very easy
For people not using maven to build and wanting to add a new project (I am using intellij 14.1.3):
Right click the top level folder in the project view, select new ->
Module
Name the module the same name as the project to be added
From the top menu select File->New->Project. Enter the same name as
the new module, same folder locations as well.
Open the Project, and wait for intellij to create the project
structure.
Close this new project, and open the original project the module was
added to in step 2
Depending on your builder, additional steps will be needed to add it to the build process.
For SBT, and in the top level project I modified the Build.scala file to aggregate the new project, and added the project in the SBT projects window. More info on SBT multiproject builds: http://www.scala-sbt.org/0.12.2/docs/Getting-Started/Multi-Project.html
"IntelliJ IDEA 2022.1.1 (Community Edition)" you have to navigate
To Add Exiting Module to same window navigate "File -> New -> Module from Existing Sources" then it will allow you to select pom.xml and then click "Create" button next window then project will be added to your current workspace.
Note :: Who ever switches from Eclipse to Intellij this is the first problem
Assuming they are under the same folder, click File-Open File or Project-<parent folder>.
you can use import module option which will open it just like eclipse in the same navigator.
For IntelliJ Idea 2021.3.3 users, The below solution didn't work for me, although I was selecting my project main folder, I've gotten only the main and test folders imported!
Peoject Structure => Modules => Import module
The solution is:
view => tool Windows => Maven => click the + icon => add the project POM.xml file
I am new to maven and did not understand how I could work with local maven project added through Viktor Nordling's answer and still have a proper dependency in pom.xml file. The answer is simple: intellij first looks at your locally added module and if it doesn't find one it goes to get the project remotely. You can check this by looking at "external libraries" under your project browser when you add or remove maven module.
Hope this helps anyone.
As of release 2019.2, this is as easy as File->Attach Project.
🎉🎉🎉🎉🎉
See: https://youtrack.jetbrains.com/issue/WEB-7968
After importing project into IntelliJ, Go to pom.xml of each module -> right click -> Click on Add as Moven Project. It will add the module as Moven project, do this for all the modules in the Project. Refer this
Can anyone explain to me how to create a uninstall command for a Windows-based application in the Application Folder when creating a new setup project in visual studio 2008.
I've found info on the net but nothing helping me so far. If you could supply me with links or instructions it would be great.
Thanks.
In Visual Studio.NET:
File > Add Project > New Project > Setup & Deployment Project > Setup Project
(Enter name and location)
Add (right-click in Application Folder > Add > Project Output):
Primary Output
If an error occurs about files that should be excluded > In Solution Explorer select your Setup project > Exclude those files (right-click > exclude)
Build > Build ’name project’
In Windows:
Create an Uninstall.bat file containing:
C:\WINDOWS\system32\MsiExec.exe /I{productcode}
(Path depends of your Windows version, check where your system32 folder is located)
(You’ll find the productcode in Visual Studio.NET > Tab Properties in the setup project you’ve just created)
Open the setup project in Visual Studio.NET if you closed it
Add (right-click in Application Folder):
Add > Project Output > File > Uninstall.bat
Create New Shortcut > Application Folder > Primary Output (enter a name)
Create New Shortcut > Application Folder > Uninstall.bat (enter a name)
Add > File > add .ico files you want to use for the shortcuts
Shortcuts properties > ‘icon’ property (use the icons you’ve just added)
Move the shortcuts to User’s Desktop/User’s Programs Menu (you can also create subfolders)
Build > Rebuild ’name project’
The setup is ready now. You can install via Setup.exe (default it’s located under the folder ‘Debug’, you can change it in Visual Studio.NET - right-click your setup project > properties > Output file name). The shortcuts will be added automatically in the coresponding folders (desktop/start menu).
You can uninstall the program via Uninstall.bat (or via shortcut naar Uninstall.bat)
The command line for uninstalling using msiexec :
msiexec /uninstall {GUID}
{GUID} is the Product Code of the setup package and you can find that in your Setup Project Properties.
The uninstall program can be as simple as a bacth with that command or maybe a separate application, executing the command and performing addional custom cleaning.
L.E. Also, here is Microsoft's online documentation for msiexec.
L.E. Good article giving code snippet for creating a C# application that performs the uninstall
It's much easier is to just add an uninstall shortcut with arguments directly to the setup project instead of creating a batch file or adding code to the main() sub or start form. This should work for any .net language using Visual Studio. I have it working for VB .net using VS2008 for several projects. Here's how:
Go to the file system definitions in the setup project. Right click in the folders section (left pane) and add special folder - System Folder.
Select the newly added System Folder in the left pane, and in the right hand pane, right click and select "add file."
Add the file msiexec.exe that is in your system32 folder (Most likely c:\windows\system32)
Go back to the left pane and drill down in the User's Programs Menu folder to the folder you want to hold the uninstall shortcut. Select it.
In the right pane right click and select "create new shortcut." In the dialog box, click on System Folder and then the msiexec.exe file. Click OK and then rename the shortcut to whatever you want like "Uninstall MyProgram."
Right click on the new shortcut and select "properties window."
In the properties window, in the arguments variable type /x [ProductCode] (there is a space between the /x and [ProductCode] You can use other switches instead of /x, if you want - check out the available switches for msiecec.exe.
That's it. Now when you run the setup project it will add a shortcut to your user's program menu to uninstall the program. One other comment, on the compile you will get a warning that msiexec.exe should be excluded because its source file is under Windows System File Protection. Just ignore this warning.
i too don't know how to find this elusive product code, but to answer your other question on removing the folder I found this document that may help you out
http://www.codeproject.com/KB/install/NET_Uninstaller.aspx
You can get this product code from your application setup project in properties window of
your
setup project
. [Select project node in Solution Explorer and click F4 and copy the Product code.]
This looks similar to ... {21F66170-1C81-40E1-AB96-3303FF098425}