not able to access JDK path in intelliJ in Jetstream XSEDE cloud - java

I am having issue when trying to associate my intelliJ project with JDK in JetStream Xsede cloud. Whey trying to access the directory through intelliJ, I can see a locked folder icon which don't allows to access it.
Steps that I followed to set the JDK in intelliJ:
Open project structure (CtrlAltShifts)
Go to Project Setting->project
Click on the new Button under Project SDK
Please let me know if any further information are required to recreate the issue.

I resolved this issue by performing
chmod 777 /usr/lib/jvm in the terminal.
Once I run this command, the lock design disappears, and the directory becomes accessible.
Thanks.
Prashant

Related

Can't import the maven project in IntelliJ Idea 2016.1.1

I am trying to import a project in IntelliJ Idea 2016.1.1 using: File->Project from existing sources->choose the required pom.xml
It comes to this dialog box, but nothing happens on clicking next button.
I had the same issue, but managed to solve it by updating my /etc/hosts file such that there is was only one entry for localhost
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
# 192.xxx.xxx.xxx localhost <-comment out this
255.255.255.255 broadcasthost
#::1 localhost <- comment out this
In my case, this problem was solved by setting the JDK in IntelliJ IDEA settings. Like this:
Before selection correct JDK, I had the red text in this field.
I have had similar issue on my spare computer, the problem appears when creating/importing Maven project. It seems for some reason it has lost the access to java SDK and it was not there, even thus I tried to re-importing it. I tried to select java SDK again with out luck. I ended up with following solution:
Uninstalling IntelliJ (2016.2.4)
Reinstalling Java JDK latest 1.8, restart the system
Installing latest IntelliJ (2016.2.5)
First time I started IntelliJ, and when creating first time new project, ensure selecting the correct SDK path (see image)
Now you should be able to (click on next) creating/importing new Maven project.
The other answers did not helped me much.
I had the same issue just now,through the idea.log, I found the problem:
Caused by: com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java" (in directory "/Users/xxx/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/182.4129.33/IntelliJ IDEA.app/Contents/bin"): error=2, No such file or directory
at
com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:408)
at com.intellij.execution.process.OSProcessHandler.startProcess(OSProcessHandler.java:51)
at com.intellij.execution.process.OSProcessHandler.<init>(OSProcessHandler.java:44)
at org.jetbrains.idea.maven.server.MavenServerManager$2.startProcess(MavenServerManager.java:367)
at org.jetbrains.idea.maven.server.MavenServerManager$2.execute(MavenServerManager.java:358)
at com.intellij.execution.rmi.RemoteProcessSupport.startProcess(RemoteProcessSupport.java:212)
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:139)
... 28 more
the jdk1.7.0_79.jdk have been removed,so it doesn't work...
I ran into this and at first it seemed due to the use of a tilde ~ in the file path of the root of the project. It also seemed to go "flaky" if you try to use a ~.
More investigation lead to:
/home/user/.IdeaIC15/system/log (might be a bit different for other systems)
Do
tail -100f idea.log
in a terminal in that directory and see what you get when you click "next"
Mine was missing / corrupt java7 instance
All this is pertaining to Linux only.
I had the same problem, turns out I had a lock on the directory. try renaming the folder to confirm this is not your issue. Once the lock is removed try importing the project.
I know this is older issue, but today I also encountered this issue. In my case it was JDK unavailable (as my IntelliJ was pointing to external JDK which got updated and old path didn't exists). Nevertheless, the issue can be different for different people. The best way to tackle this problem is to check intelliJ logs, that will tell you exact issue it is facing and then proceed with its fix. I'm sure this will save your time and you will solve the issue very quickly.
How to locate idea.log file is here
P.S. May be when you read this post, the above link to locate idea.log file stale. So kindly get the updated link from IntelliJ jetbrains website (Look for idea.log file path)
OR follow the below steps:
1. Open intellij
2. Click on Help tab from menu-bar
3. Select Show log in Finder. Get the path to this path and do tail -f </path-to-file/idea.log>
In my case to solve this problem I did a strace on Linux of the Intellij Java process that is called when you do a next (+ child processes) and discovered that it was related to the execution of the Maven embedded jar.
Execution of the Maven embedded jar (process 4940):
4940 execve("/home/rudy/Softwares/jdk1.8.0_111/bin/java", ["/home/rudy/Softwares/jdk1.8.0_11"..., "-Djava.awt.headless=true", "-Didea.version==2018.1.4", "-Xmx1024m", "-Didea.maven.embedder.version=3."...
Error returned by the process 4940:
4940 <... execve resumed> ) = -1 ENOENT (No such file or directory)
I had decided to move the jdk8 to a directory home/rudy/Softwares/jdks/jdk1.8.0_111 and it was previously in home/rudy/Softwares/jdk1.8.0_111.
It seems before to move JDKs used by Intellij to first reconfigure Intellij to use the new path and then use the import maven functionnality.
I did a mistake, it is true (moving the JDK) and Intellij has no way to know where the JDK was moved (unless scanning the all filesystem) but it should clearly display an error message and not get blocked on the 'next'.
I had this issue today and it took me 2 hours to identify and fix it.
I tried to import the project from perforce workspace which had '/' in the workspace name (ABC/lighting_workspace).
When I created another perforce workspace without '/' in the name (lighting_workspace), I was able to import the existing project :)
Had exactly the same issue, in my case it was a memory problem: the importer needed more memory than the one allowed by the VM's limit set by default after the installation of IntelliJ: I had 768 mb set by default and i moved them to 2048 mb.
You can set this under :
Preferences |-> Build, Execution, Deployment |-> Build Tools |-> Maven |-> Importing |-> VM options for importer
Install latest version of Intellij Idea (leave everything by default) and Java JDK (called SDK in IDE).
Create a new empty project.
Press Ctrl+Alt+Shift+F to open Project Structure panel.
Chose the SDK you downloaded, like : C:\Program Files\Java\jdk-10.0.2.
Apply and File->Open your project
Now it work ! (Also cleaned my host file)

Downloading Eclipse plug-in from Eclipse Marketplace for offline usage

A plug-in that I want to install (Eclipse Jubula Database Drivers) is only available in Eclipse Marketplace. However, I need to install it to an Eclipse package running in a machine that is not connected to the Internet. Is any way to get the update site address so I can download the files for offline installation? This answer solves the problem to download an update site, but I don't see a way to get the update site address from eclipse marketplace
On every plugin page of Eclipse Marketplace, use the rightmost icon underneath the "Install" button. That opens an overlay containing the URL of the update site.
Yes. After spending a couple of weeks, I found this simple process:
Unpack Eclipse in folder A
Unpack Eclipse in folder B
Start Eclipse in folder A
Install the plug-in
Delete all files in the folder plugins/ which are the same in both Eclipse installs.
Delete all files in the folder features/ which are the same in both Eclipse installs.
That leaves you with the files necessary to run the plugin. But since this isn't an update site anymore, you can't easily install the plugin.
To solve this problem, you have two options:
Put the files into the dropins/ folder
Create an update site using the files which you identified. Good luck with that. I tried it for months but the result was unstable at best ("Component can't be installed because ...").
Just to follow up on Aaron's answer, the relevant files from plugins/ and features/ go into a new folder eclipse/ which can then be put into the dropins/ folder.
So for a concrete example, I wanted to install the Jenerate plugin to an offline machine. At the time I tried this, the update site was offline. So I went ahead and installed it via Marketplace on another machine with internet access, which lead to the creation of a folder features/org.jenerate.feature_1.0.2 as well as a jar plugins/org.jenerate_1.0.2.jar. I put those into newly created directories on the offline machine in dropins/jenerate/eclipse/features and dropins/jenerate/eclipse/plugins, respectively. See also this Eclipse help document.

Unable to clean project in Android Studio

OS version: Ubuntu 14.04 LTE 64 Bit
Java JRE/JDK version: Oracle JDK 1.8.0_11
Project directory is on a NTFS based drive.
Whenever I try to clean my project I get something like below.
:app:clean FAILED Error:Execution failed for task ':app:clean'.
Unable to delete file: /media/DriveA/AndroidStudioWorkspace/DNA/app/build/intermediates/classes/debug/.../mechandising/MerchandizingActivity$3.class
When I try to delete the build folder manually I get the following error.
Error when getting information for file
'/media/DriveA/AndroidStudioWorkspace/DNA/app/build/intermediates/pre-dexed':
Input/output error
I am unable to figure out whether its a Linux problem or a Studio problem. I don't face such a problem in Eclipse (Same Drive) so I am just considering it to be something wrong with my studio.
Any Suggestions??
I had the same problem.
You need to go to the source file directly.
Close the studio and go to the path the issue is located at and delete the folder there.
Go to
File > Settings > Build, Execution, Deployment > Instant Run > Uncheck
this Check box (Enable Instant Run to hot swap code)
Thanks
Have a nice coding
You can go into the project directory and call gradle from the command-line to do a clean on the project:
gradlew clean
When you reopen the project you will need to run a gradle sync again.
Just ran into the same issue now - I accidentally edited one of the generated files and wanted to rebuild the app, but both clean and build failed due to some files being locked.
Luckily, I got cygwin on my Windows machine, so ls -l <file that studio complained about> revealed that these files were owned by some Administrator dude.
My first thought was that these files might had been created while Studio was running with admin privileges (I do this when I need to fetch updates from SDK manager). The idea was to try and resolve this issue by executing clean in Studio running with admin privileges, and later rebuild with normal privileges. Nope, this did not work :(
I decided to go for the brute force: sudo rm -rf app/build/* (in Cygwin this command looks a bit different: cygstart --action=runas rm -rf app/build/*). This resolved the issue and I was able to rebuild the project in Android Studio.
I had the same issue as you. I tried some of the solutions proposed on this page and it didn't work. So I used Process Explorer to find which process is locking the apk file and it was firefox. I think it keeps the file locked when I upload the apk in google play console. To make that go to "Find > Find Handle or DLL... > path-to-your-app.apk".
Hope it help
On Linux this could happen if you have a locked directories that prevents Android Studio from Deleting files.
you can run the Following command on Terminal:
sudo chown -R $USER: $HOME
Then try to rebuild --> Works for me
I stopped the windows defender it was locking the file because it was need to scan , and the problem resolved
Go to your projects directory in the terminal and run gradlew clean
To run a Gradle command in your terminal/command prompt. Navigate to the root of your project and type gradlew in the terminal or gradlew.bat for the command prompt (windows users), followed by the command you would like to execute.
For a list of all possible gradle commands type gradlew tasks into your terminal.
I had a similar problem, when I was trying to debug my first android app. If you are running Android Studio on windows, I just restarted the Android studio and I did run Android Studio as Administrator which fixed the issue.
I solved this issue by closing android studio -> remove android platform via cli and then -> add the android platform again -> open project in android studio.
I'm not on Windows, but OS X. Somehow my build folder didn't have the proper permission for AS to delete the file so I did chmod -R 777 <your_directory> in the affected parent directory.. probably 777 isn't what you would want but it worked for me.
Thanks to Gal's answer (https://stackoverflow.com/a/39904628/2870404).
In windows, using Windows file explorer,
right-click on the directory,
click properties on the context menu that will appear,
then uncheck the "Read Only" attribute.
After that, click the "Apply" to apply changes.
This fixed my problem.
Thanks to Gal's answer (https://stackoverflow.com/a/39904628/2870404).
In windows, using Windows file explorer,
right-click on the directory,
click properties on the context menu that will appear,
then uncheck the "Read Only" attribute.
After that, click the "Apply" to apply changes.
I had the same problem.
To build the project again and again I had to delete the build folder each time. The problem for me was an anonymous program called ByteFence.exe running in my system. When I uninstalled that program my issue was solved.
none of above answers didn't work for me, but change permistion works:
chown user:staff ../project_dir
find ../project_dir -type d -exec chmod 775 {} \;
find ../project_dir -type f -exec chmod 664 {} \;
It should be a process lock the file handle. You can try to open your task manager to kill the process. In my case, the process is one of the Java process hold by Android Studio OpenJDK. Just find it and kill it.
I came to this thread because I was having issues with my /release/app.aab getting locked. This prevented me from completing a project clean and generating a signed bundle. My work around was to restart my computer to get permissions back until I solved the issue.
It turns out that Git was locking the app.aab, and all I had to do was add "/release" to my /app/.gitignore.
Hope this helps someone.
1) Go To File > Settings > Build, Execution, Deployment > Instant Run > Uncheck this Check box (Enable Instant Run to hot swap code).
2) Restart your android studio
Running android studio as administrator in windows worked for me. :)
1) first run cordova clean cammand
ionic cordova clean
2)After that run build command
ionic cordova build android
I solved it by Upgrading gradle version in build.gradle(project)

Android Studio - supplied javaHome is not a valid folder

I decided to update my JDK to Java 8, and installed to the default location of C:\Program Files\Java\jdk1.8.0 with a jre subdirectory.
I wasn't sure how Android Studio worked out the JDK location, so I decided to launch it and see. I got the following message:
Failed to complete Gradle execution.
Cause:
Supplied javaHome is not a valid folder. You supplied: C:\Program Files\Java\jdk1.7.0_45
I updated my JAVA_HOME environment variable (both for system and user) to point to the new path, and tried adding it to my PATH variable as well, but every time I attempt to build in Android Studio I get the same message. The quoted path is nowhere to be found in my environment variables though, so where is it getting it from and how can I change it?
Thanks
The problem was my project's JDK location. From the Android Studio Project tool window, I right clicked on the root directory, selected 'module settings', and set the JDK location. Everything's fine now.
I don't know why or how this problem occurred but this answer got me over the hump. On macOS rm -rf ~/.gradle to wipe out the cache then restart Android Studio. I tried everything else up to and including reinstalling the JDK and Android Studio. Wiping out the .gradle directory is the only thing that worked.
Try to delete all .iml files and .idea, and re-import the project from Gradle. Worked for me (provided you have everything else set up).
This error happens when you switch from Intellij to Android Studio, or the other way around, and load the same project. Looks like their project model is not compatible.
For Android Studio 1.1.0, after right-clicking on the project:
Select Open Module Settings
Select SDK Location at top left
Type text into JDK Location: box
I ran into the same issue. My jdk was upgraded from a 1.8.0_172 to 1.8.0_202. And I kept getting the mentioned error although I changed to the right jdk, in the module configurations. What confused me was the fact that the API version was stamped with the old *_172 version in the dropdown of available project sdk's. I found the reason for this to be an old obsolete entry in the dropdown that referenced the old *172. After deleting this entry, the APi versions was magically stamped with the new version.
Note to self: Remember to sanitize your projects when new versions come along
I was also seeing this same problem. For me the fix was in 'Run/Debug Configurations' (Run > Edit Configurations...)
The 'Gradle project' value was set to the build.gradle file location, and this should've been set to the Gradle project object in IDEA, click the folder looking icon not the '...'.
I'm in 1.0.2 and after I clicked OK, it immediately opened a dialog to allow me to specify the location for my project, no longer requiring navigation of the menus to edit the project JDK path.
Definitely strange that during install, it says the JAVA_HOME environment variable is set to a path that doesn't contain the JDK. After spending time fixing it (downloading the full 64 bit JDK), I create my first project and get the same thing. Because it's not using the environment variable that it hinges on during setup.
Odd behavior.
For some reason I failed using all the above answers, so what I did is to delete (actually moved, so that I could go back in case something goes wrong) the ".idea" folder from the project. Then I opened the IDE again, and it went fine.
Getting this in 2021? Try to to rm -rf ~/.gradle and restart Android studio.

How do you make Git work with IntelliJ?

I am going to use Git version control by IntelliJ Community Edition in order to make branches of the programs I intend to develop. I am striving to accustom myself to its functionality and I come accross obstacles.
I follow the instructions of the web-page http://wiki.jetbrains.net/intellij/Using_Git_Locally and although I do what it orders, when I reach Image5 I find an empty list under Default.
It is possible that it does not matter I thought, so I continued the procedure.
However when I come to most important section of Committing Changes to Master (Revision 1) the list is also empty and the commit changes does not detect any changes to my project (see Image13 and Image 14).
Apart from that, I receive a message when I open the project once more indicating that the Git execution path is not correct. But how can I get knowledge of what execution path should be appropriate so as to insert it?
Does anybody know a decent order of instructions (on a web site or by his won experience) which can guide me to how I can take advantage of Git functionality to incorporate it to my work? It is crucial for me to put my work through.
You need to specify the executable path of Git in the Git Settings, as mentionned in the per-requesites:
The Git integration plugin is enabled and the location of the Git executable file is correctly specified on the Git page of the Settings dialog box.
As long as you see "a message indicating that the Git execution path is not correct", the rest of the instructions won't work.
Path to Git executable
In this text box, specify the path to the Git executable file.
Type the path manually or click the Browse button to open the Select Path - Git Configuration dialog box and select the location of the Git executable file in the directories tree.
See "Where is git.exe located?" for the path of Git on Windows.
with Git for Windows:
C:\Program Files\Git\mingw64\bin
OR
c:\path\to\PortableGit-2.6.2-64-bit\usr\bin
OR
c:\path\to\PortableGit-2.x.\mingw64\bin
With GitHub Desktop:
%USERPROFILE%\AppData\Local\GitHub\PORTAB~1\bin\git.exe
Update 2020, three years later:
As noted by Daniel Connelly in the comments
IntelliJ now lets people install it through the path specified in the help above (just look for the "Download Now" button on the Git menu).
If you download Git from the website, a version that IntelliJ does not support will be installed.
GitHub for Windows on Windows 7 currently installs Git in a path similar to this:
C:\Users\{username}\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\bin\git.exe
The guid after PortableGit_ may well be different on your system.
On unix systems, you can use the following command to determine where git is installed:
whereis git
If you are using MacOS and did a recent update, it is possible you have to agree to the licence terms again. Try typing 'git' in a terminal, and see if you get the following message:
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
On Window machine install any version of Git. I installed
Git-2.14.1-64-bit.exe
. Got to search program and search for git.exe. The file can be located under
C:\Users\sd\AppData\Local\Programs\Git\bin\git.exe
.
Open Intelli IDEA>Settings>Version Control>Git. On Path To Git executable add the path. Click on Test button. It will show a message as
Git executed successfully
Now click on Apply and Save. This will solve the issue.
.
git.exe is common for any git based applications like GitHub, Bitbucket etc. Some times it is possible that you have already installed another git based application so git.exe will be present in the bin folder of that application.
For example if you installed bitbucket before github in your PC, you will find git.exe in C:\Users\{username}\AppData\Local\Atlassian\SourceTree\git_local\bin
instead of C:\Users\{username}\AppData\Local\GitHub\PortableGit.....\bin.
For Linux users, check the value of GIT_HOME in your .env file in the home directory.
Open terminal
Type cd home/<username>/
Open the .env file and check the value of GIT_HOME and select the git path appropriately
PS: If you are not able to find the .env file, click on View on the formatting tool bar, select Show hidden files. You should be able to find the .env file now.
Literally, just restarted IntelliJ after it kept showing this "install git" message after I have pressed and installed git, and it disappeared, and git works

Categories

Resources