IntelliJ IDEA 12.0 Scala worksheet errors under Standard User account but works under Administrator - scala

When I try to evaluate Scala worksheet in IntelliJ IDEA 12.0 with latest Scala plugin (December 5 2012 version) under Standard User in Windows 7 (32) it says:
Cannot start process, the working directory
C:\Program Files\JetBrains\IntelliJ IDEA 12.0\bin does not exist
The directory really exists.
Evaluating Scala worksheet on the same machine under Administrator account works as expected.
What do I do wrong (besides using Windows)? What can I do to fix the problem (besides using it from Admin account)?
Thank you!

It seems that IntelliJ IDEA is using the installation directory as the default working directory for Scala worksheets. You can change this setting in the Run configurations settings: go to Run > Edit configurations... Once here expand Defaults and select Worksheet. On the right pane you will see an empty text field named Working directory:
Either enter an existing directory or select one using the button on the right. The directory you specify here will be used for all the worksheets you create. You may also specify a per run configuration working directory if you enter the directory in the corresponding worksheet run configuration instead of in the Defaults section.

i have had the same issue with Scala Plugin but the problem is resolved if you use the Edit Configuration to set working directory to current working directory (basically anything other than empty)
this also happens if you do not use external build mode.

Obviously change permission to directory. Do not run any single non-daemon task under Administrator. If similar troubles continue to repeat - consider switching from deprecated OS, to something more stable, to ease your development efforts.

Please follow the issue http://youtrack.jetbrains.com/issue/SCL-5049 to get information when it will be fixed.

Related

"Errors exist in the active configuration..." Eclipse Dialog when Debugging

An "Errors exist in the active configuration of project X. Proceed with launch?" dialog appears while debugging code in Eclipse. Hitting the "Proceed" button results in successful debugging. There are no apparent errors with the launch configuration. A similar Run Configuration does not generate the error.
This is caused by an invalid path somewhere in your Eclipse project settings. There are a couple common sources for this kind of error.
You're working on a shared (version controlled, copied, etc) project where someone has hardcoded a path that doesn't exist on your machine, or uses an environment variable that you've not set.
Sometimes, you can find the offending path by looking at the full list of Error messages. If not, look in your project file.
The Discovery Options in your project properties has 'Automate discovery of paths and symbols' enabled - but the process is generating an error.
If you're using a version of Eclipse that warns you this option is deprecated, uncheck the option to disable it and fix any includes in 'Preprocessor Include Paths' instead. If not. . .try it anyway.
Depending on your path changes, restart Eclipse and try again.
It starts the executable that was built last before you broke the build. That executable will be older then your source files. The reason you were able to debug is because your line numbers did not change for the code you've debugged - e.g. you may try break in main then introduce a compilation error and move main a couple lines below - the debug will highlight the wrong lines when it stops.

Intellisense in IntelliJ no longer working

I'm currently running IntelliJ IDEA 13.1. While running IntelliJ 13 intellisense/autocomplete stopped working. I tried upgrading and it still doesn't work.
I can explicitly invoke code completion using ctrl+space. I looked in Settings->Editor->Code Completion and nothing looks out of place. Is there somewhere else that turns this feature on/off?
For me it was because I did not have a folder marked as Source Root (it appears in blue).
To fix, right click your root source directory -> Mark As -> Source Root.
Check to see if you accidentally turned on Power Save (File/Power Save Mode) I myself just discovered that File/Power Save Mode does turn it off. I was having the same problem and must have accidentally set Power Save Mode to on.
I'm using Mac and when I upgraded to Big Sur my intellisense stopped working.
This is due Big Sur has a shortcut for Input Source. By disabling Mac shortcut, will make Intellisense work again.
You can see the option to disable in mac:
File -> Settings-> Editor-> General -> Code Completion-> Auto pop up code Completion
If other options mentioned is already true for you,try Setting up Sources/Test folder as Sources Root/Test Sources root as it did the trick for me. I had forgot it.
Right click on folder, choose "Mark Directory as" Test Sources or Sources Root, or whatever applicable. :)
Try disabling all plugins you have. I installed Codota and it turns out to be garbage. I uninstalled it and disabled the plugin in IntelliJ and it worked
Had the same problem and none of these helped. What I realized was that on mac, control + space is used by the OS to change language inputs and it overrides intellij. So if you are on mac having multiple input languages on your keyboard, consider changing the shortcut for it :)
I tried all the above option and it did not solve the issue. In my case:
THE ISSUE: node_modules was not loaded in the file structure of the project.
THE SOLUTION: go to explorer(finder/nautilus) find the .idea folder in the project and delete it. Then re-import the project. Once I re imported the project it loaded the node_modules folder as library root
Note: It will take a few seconds for IntelliJ to index all the libraries. You will see a loader on the bottom right next to line number info.
In my case, I restarted the Intellij and everything came back to normal.
Had the same problem until:
Third party JDK installed
Configured in module settings: right click on project name, then "Open module settings" -> SDKs -> "+". Pick the jdk root folder and Idea will take care of the rest.
Re-indexed a bunch of things. It happens automatically, just be patient
For me, it was I hadn't yet set up the JDK.
Type something out, Ctrl+Space to try to autocomplete. If it fails, do Alt+Space and if the option comes up to setup JDK, do that.
In IntelliJ 2017-2 to configure Autocompletion:
Settings -> Editor -> General -> Code Completion
In case this helps anyone; for me it was a windowing glitch of some kind. The suggestions popup showed on the wrong monitor, which I didn't notice the first time it happened.. after a while I saw what was happening. Resizing the window seemed to fix it.
If you're too lazy to restart your machine to fix the issue, you can kill the process taskkill /F /PID pid_number_of_idea64.exe (task manager -- view>select columns>PID) and then open CMD, head over to C:\Program Files\JetBrains\IntelliJ IDEA xxxx.xx.xx\bin, start idea.bat. Let this CMD window open.
Please note that even after executing taskkill, idea64.exe process doesn't disappear from task manager. Try executing the same command again and you'd know that process doesn't exist anymore.
For me the code completion suddenly stopped working because I had nudged the IDEA window slightly off-screen, maybe just a pixel or two, which caused the code completion pop-up to (presumably) appear off-screen. Making sure the application window was fully visible fixed the problem.
In case none of these work for you, if you are using IdeaVim, make sure your ~/.ideavimrc does not override Ctrl+Space, you can check this in vim:
:verbose map <c-space>
In my case, it was set by ~/.vim_runtime:
Last set from ~/.vim_runtime/vimrcs/basic.vim line 208
Thanks #s1n7ax for the tip!
IMPORTANT
If you had your email logged-in on IntelliJ Idea for a while and its token expire the Intellij will suddenly stop working or crash(My Version 2020.1.1).
Do two things.
1. file > sync settings with JetBrains account (log in here)
enter code here.
2. file > Invalidate cache / restart
I'm using Maven project, it works by:
File > Project Structure > Modules > Sources
and then marked java files dir as Sources.
reference link.
Spent hours to fix this problem too. For me, the answer was to disable a plugin.
Which one to disable? Just find out using trial and error since all kinds of plugins can cause errors...
It depends which product, for Intellij I might have to right click and import the .iml file from the root, or in Rider right click the solution file and open that. I'm only making this mistake 4 or 10 more times, and then it is never happening again.

Adding Environment Variables to Eclipse shortcut

Is it possible to set an environment variable for the current run of Eclipse ( RAD )?
Here is my situation
I have RAD 8.5 and RAD 9.0 installed on my box. It stopped working all of a sudden last week. It wouldn't even come up. When I checked the logs, both the versions had below error in the logs
java.lang.NoClassDefFoundError: com.mercury.ftjadin.hooks.interfaces.WToolkitHookQTJA
After some research I also found out that it is caused by HP's product that was installed on my box ( It was done as a corporate push and I wasn't even aware of it ).
Further research also revealed that there are about 4 environment variables that have a conflict with Eclipse and should be removed / blanked out for RAD to work. This will of course cause the HP product to not work.
So, I was wondering if there is a way to set these to blank in eclipse.ini file for each of the RADs or as part of the shorcut of RAD which is
C:\Software\RAD90\eclipse.exe -product com.ibm.rational.rad.product.v9.ide -showlocation -nosplash -clean
but not blank them out in the Environment Variables definition
This way, I will be able to use both the products without having to save the variable values between RAD and HP Mercury product usages and do not have to do a copy / paste every time which is prone to user errors / mistakes.
Hope the question makes sense. Please let me know, if I need to clarify anything.
You can start eclipse (for example RAD) from eclipse (for example a minimal Java plugin development) and in that case, you have the option to set the environment variables you want to use.
You have to set the target environment to the RAD instance and create a run configuration with the proper environment.
I know, this is less than ideal, but should work.
Another option would be the unsetting env variables (locally) in a batch file:
set var=
Though I do not know whether it would work or not.
This page helped my situation
Instead of playing with registry I took an option of batch
These suggestions will allow to work around this situation even with the environment variables in place and with corresponding values. Note: Conflicting application will not be recognized in a java context because it is being excluded from the java support mechanism.
Impact: Excludes Add-ins support from hooking to conflicting application executable via Windows Registry Editor
Requirement: The application must be started by an EXE file, except Java.exe/Javaw.exe/jpnlauncher.exe
Instructions:
a. Locate the executable filename of the application conflicting with add-in(s) support. Either use the Task Manager or the Microsoft Process Explorer.
b. Open Windows Registry Editor.
c. Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\JavaAgent\Modules
For 32bits applications on Windows x64:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercury Interactive\JavaAgent\Modules
d. Create a DWORD value with the name of the conflicting software executable filenmae and set the value to 0.
Impact: Does not load Java Support for specific launched session
Requirement: Application be launched using a batch file
Instructions:
a. Create a batch file (.bat)
b. Copy/Paste below coding before executing launching of Java application.
#ECHO off
Set _JAVA_OPTIONS=
Set JAVA_TOOL_OPTIONS=
Set IBM_JAVA_OPTIONS=
This approach will disable the java environment variables for the run session of the .bat file. Once batch execution closes, environment variables changes are lost.

Eclipse Build Error "A class file was not written. The project may be inconsistent, if so try refreshing this project and building it"

I have been struggling with a very weird issue that has suddenly popped up on the latest version of Eclipse Classic (4.2.2).
Everytime I try creating or refactoring a class or subclass in any of my projects (all Java) in my Eclipse workspace I get an error at the very top of my class that says
A class file was not written. The project may be inconsistent, if so try refreshing this project and building it
Again, this happens when I create new classes. And even when I rename current classes, then undo the renaming, its totally fine, but changing a single character in the name causes this error to happen for that specific class.
I have Auto Build on, and I tried multiple times to clean and refresh every project as well as restart Eclipse entirely.
I have literally no idea how to even start figuring out how to fix this. The solutions i've found through search didn't help, so i'm hoping I might find any clues here.
I had the same problem and here's how I solved it in the end:
It turned out that the disc space on the drive where workspace resides was full.
Silly mistake but worth checking.
In my case, this was caused by the fact that the build output directories were owned by a different user, and Eclipse could not write into them.
I had the same issues, the following worked for me:
Right click eclipse then running "as an Administrator"
Click Project > Clean.
Clean your workspace by starting eclipse from the command line with the -clean argument :
eclipse -clean
See also How to run eclipse in clean mode? and what happens if we do so?
I solved this problem by running Eclipse as root.
I had the same issue on Mac OS X. I had a maven project.
Try running the following command on Terminal. This looks like an access issue.
sudo mvn clean
Provide password for admin user.
Then open Eclipse and refresh your project.
We are using Eclipse here too and have to handle a workspace with more than 200 plug-ins. Every now and then people have similar problems with their workspace and inconsistencies reported in a weird way by Eclipse.
What people here usually do is (next step only in case previous step didn't help):
- trying to ContextMenu->Team->Clean/Refresh the whole workspace
- creating a new workspace and check out all necessary files from the repository
- reinstalling Eclipse to a new directory
From my experience after using the Eclipse IDE on a daily basis for many years, it doesn't make very much sense to waste too much time with these issues, unless they aren't solved by one of the steps above. It takes too much time to struggle with these things, while starting from scratch is done in an hour or less (and usually fixes the issue).
If your Eclipse still behaves strangely it might make sense to go through your installed plug-ins. Not all external plug-ins follow the Eclipse guidelines and can seriously harm the performance and operational consistency of your Eclipse installation (E.g. Sonar Plug-in, Toad Plug-in, ...)
In my case this kind of error caused due to disk space got full and it got resolved by just freeing disk space where eclipse have been installed.
That is c/d/e drivers.
I come up with the same error, and in my case, this is because the permission of the project/bin directory is not recursively 775
I fixed it by:
Remove the project/bin directory: sudo rm -rf project/bin
Switch to Eclipse, rebuild the project: Project->Clean...
Then no errors.
Try to launch Eclipse as Administrator.
In my case such error was caused by a question mark in a quoted method name (I use geb+spock combination for automated testing).
So this method name will throw an error "Do you want something?"()
And this will not "Do you want something"()
It may not be the best response but to fix it, I've just delete the error marker.
Had the same issue. but cleaning the project and restart eclipse didn't help and disk space was not the issue. Solved the issue by copy the code to notepad(just to not lose it) and then delete the class, recreate it and paste the code back in again.
I solved it changed the owner of the project files. I changed from root(old owner) to user my current(user that i use with eclipse).
Just changed and saved java file to recompile the class. Then error disappeared.
I was try run
Project->Clean...
And Rebuild. My problem was resolved
For linux (Debia) and working on Spring boot project (maven):
$ sudo mvn clean
Then open Eclipse and File -> Refresh.
I had same issue, it is something similar but this post didn't help in my case. I have many inner classes which is causing the compiler to create class names with all inner class names together that is creating class name more than 255 character file limit on NTFS! read it in some other blog. I thought it will be helpful to post here.
Ex : classA$InnerClassB$......InncerClassZ.class in target folder it won't generate the class if it exceeds this limit. Try renaming your inner class name shortened. In my case i have to add InnerclassZ as its exceeding its not generating class and Eclipse complaining.
A class file was not written. The project may be inconsistent, if so try refreshing....
I shortened InnerClassZ to IClassZ fixed the issue.
I had the same issue and it got fixed by running eclipse in administrator mode
Eclipse Shortcut-->Right click-->More-->Run as Administrator
I've been throught that error once when I used wsdl2java to extract java classes from a wsdl, it turns out that all classes were created in the same "class", causing end classes with long names (error - File name too long). When I organized and rename some classes the error disappeared.
I had this issue. I did the following, it resolved.
Open Eclipse in Administrator mode; Right click on eclipse.exe "Run as administrator"
Clean all projects.
#Denny's answer put me on the right track, though in my case it was the target directory. I deleted it for some reason and something automatically recreated with owner root. Changing the directory owner was not enough as it contained files that were also owned by root. So make sure to really remove the complete content of the directory and to change the owner.
In my case current user didn't have access to this project dir
Before giving a try to the above solutions. Just cleaned the project and it worked.

Google App Engine Eclipse Launch Local Host Multiple App Conflict?

I have two GAE projects created through pydev in eclipse 4.2 (windows 7) and the first one I had no issues running the localhost:8080 but when I created a second project, I duplicated the Run Configuration for local run adn just changed the project name to the new one.
However- when I run that config the inital HelloWorld project shows up[ in my browser, I tried completely removing the first project, but then it just ocmplains it cant fint app.yaml in the old directory (because the old directory isnt where it was).
So clearly I'm missing some setting in the launch procedure where it sets the root path.
The run config is a PyDeb Google App Run, main module points to
C:\program files (x86)\google\google_appengine\dev_appserver.py
And the arguments are
${project_loc}\src
Everything else is on the default settings.
Any help would be greatly appreciated as pushing to Google (which works fine for both) for every little debug iteration is driving me a bit crazy.
Thanks!
*EDIT: Forgot to mention I have already tried to delete all runconfigs and remake.
Have you tried Run as : PyDev Google App Engine Run, to create a new runconfig?
Turns out I'm just a bit silly. In eclipse, I wasn't properly turning off (not sure on the correct term there) the LocalHost for the first project before starting the second. To fix, I needed to go Into eclipses console window, and select "display selected console" and choose the project I wanted to stop and hit the stop all button. Then it runs fine.
Hope this helps someone in the future, that is as determined as me that "It can't be my fault".
Cheers.