Java 7 && IntelliJ - intellij-idea

I installed openjdk 1.7.0 and set it up in IntelliJ 10.5
When I compile (anything) I get the error "Fatal Error: Unable to find package java.lang in classpath or bootclasspath".
I looked at this question:
IntelliJ gives Fatal Error: Unable to find package java.lang in classpath or bootclasspath but all jar files inside the lib directory are already added.

Ok. I was wrong there weren't all jars added. I found some more in (sub)directories other than 'lib'. After adding all those manually everything is fine. Seems like even IDEA 10.5.2 does not like the structure in openJDK yet.

Try IDEA 10.5.2. Make sure that JDK path is not a symlink. If the issue remains, specify your OS and attach a screenshot of JDK classpath configured in IDEA.

I had the same problem. I added all jar files in the following directories manually:
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/1.7.0.jre/Contents/Home/lib
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/1.7.0.jre/Contents/Home/lib/ext

Related

impossible to install a intellij idea

I downloaded the ultimate version of IntelliJ from the official website and when I do ./idea.sh in the .. /bin directory of the file I get this error message in the terminal:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.Error opening zip file or JAR manifest missing : /root/.jetbrains/jetbrains-agent-v3.2.0.de72.619 Error occurred during initialization of VM agent library failed to init: instrument
I don't know if I am supposed to have a .jetbrains file in my repersonel if so why I don't have it and if not how to get it?
Cordially...
What's the environment of your machine and I do not think you need to care about how to get .jetbrains manually by yourself. I've installed a IntelliJ idea on Ubuntu18.04, it works well. You can try run it as an administrative, also you can go to ./bin folder and then run ./idea.sh rather than ../bin folder
btw, as I said install, it does not indicate we need to compile it and get some executable binary file to run it. It's a green software that contains anything you need, you can run it directly
The Error opening zip file or JAR manifest missing : /root/.jetbrains/jetbrains-agent-v3.2.0.de72.619 error indicate that there is a problem with the distribution you have downloaded. It was corrupted or modified improperly.
Re-download it from https://www.jetbrains.com/idea/download and install into a new empty directory.
You can also try deleting the IDE's config and system directories.

IntelliJ Gradle "Unable to find Method"

The Error:
Failed to sync Gradle project '-'
Error:Unable to find method 'org.gradle.internal.logging.progress.DefaultProgressLoggerFactory.(Lorg/gradle/internal/logging/progress/ProgressListener;Lorg/gradle/internal/time/TimeProvider;)V'.
You can see, a constructor inside a class, which is found in the logging jar (gradle_home/lib/grade-logging-version.jar) is missing.
So, I think the Class-Path does not contain this jar file.
Gradle Version: 3.5
Running using the Command Line works.
I have already tried this:
Gradle sync failed: Unable to find method
to-find-method, it does not work for me.
I have tried to use different versions.
I can't see any difference when enabling
"Use default gradle wrapper"
"Use gradle wrapper task configuration"
"Use local gradle distribution".
I had the exact same problem today.
The only way I was able to get it to work was to remove my IntelliJ IDEA IDE, get the latest from the website (with JDK) and put it in a new folder (i.e. no overwriting existing files).
After that, I deleted the .idea folder from the project and reimported it cleanly into the "new" IntelliJ.
I suspect upgrading IntelliJ from Version <= 2016.x caused the issue, since a new installation / clean extraction from archive caused it to work on the fly.

DeepLearning4j examples maven project unable to be processed by Intellij

As shown in the screenshot there is a dependency of the dl4j-0.4-examples project that is unable to be loaded by intellij.
Unable to get dependency information: Unable to read the metadata file
for artifact 'com.github.jai-imageio-core.jar': Invalid JDK version in
profile "java8-and-higher': Unbounded range [1.8
A similar problem resolved in this question
https://github.com/google/gson/issues/596
as quick fix open the pom file at your local repository and add ')'
and should looks like
91 [1.8,)
save and execute again
But in this case there is no jdk tag: so that approach can not be used.
Has anyone found a workaround to load this project into intellij?
The owners of the project have recognized this as an issue. If you would like to follow along here is the bug tracker:
https://github.com/deeplearning4j/dl4j-0.4-examples/issues/76
Update 2/28/16: The resolution: I needed to do
brew switch maven 3.3.9
There were multiple versions of maven installed on my machine but I did not know about brew switch. So some ways maven was working without doing the switch - but for this project a completely clean maven installation was required.

Importing gradle project in IntelliJ

I have IntelliJ 12.0 on and gradle 1.2. on Windows 7. When I try to import a build.gradle file I get the following error message in IntelliJ. I am a bit lost here. Any ideas on how to fix this?
(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.jetbrains.plugins.gradle.remote.GradleApiException:
Could not fetch model of type 'BasicIdeaProject' using Gradle installation 'C:\Program Files (x86)\gradle-1.2'.
The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch:
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=c:\program files (x86)\jetbrains \intellij idea 12.0\jre\jre,daemonRegistryDir=C:\Users\Nilo\.gradle \daemon,pid=5144,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX: +HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252]
Actual: DefaultDaemonContext[uid=d8c5c4bc-5488-42c2-b4b3-28c1d53afacf,javaHome=C: \Program Files (x86)\JetBrains\IntelliJ IDEA 12.0\jre,daemonRegistryDir=C:\Users\Nilo \.gradle\daemon,pid=6880,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252]
at org.jetbrains.plugins.gradle.remote.impl.GradleProjectResolverImpl.resolveProjectInfo(GradleProjectResolverImpl.java:61)
... 21 more
my fix: File -> Project Structure -> change the jdk path to not have jre.
I'm not sure how it got there, but it took me forever to track down. Perhaps because it picked up settings from a previous bad install.
Looks like it might be fixed in 12.1 or 12 EAP: IDEA-102365, IDEA-89697
Though I did not find the root cause where the different javaHomes have been taken from, at least I found a workaround that worked for me:
Try setting the following in your gradle.properties (either in %USERPROFILE%\.gradle\ or in your project build dir):
org.gradle.java.home=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.0\jre
IntelliJ v15.0.6, same problem.
I'm using a JRE that's not the one that is built into IntelliJ.
I made sure JAVA_HOME was pointing to my JRE, then
I deleted "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\", then
I restarted IntelliJ.
Now my gradle build scripts work fine from within IntelliJ.

Maven not recognizing javac in my Ubuntu installation

I have gotten this error:
Compilation failure
Unable to locate the Javac Compiler in:
/usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
Now I have set some info in my .bashrc file like so: export PATH=$PATH:/usr/lib/jvm/java-6-openjdk/bin. I also did it in my /etc/profile file. But it still fails. But I am noticing that the above error is still going into jre instead of jvm. I don't really understand why its doing that. When I do which javac, it directs me to /usr/bin/javac. What exactly is that file? It seems Ubuntu defaults to JRE rather than the SDK. Either way I am confused as to how to fix this. Any help would be appreciated!