Eclipse build issue - java

I am trying to build a project into Eclipse and I'm getting this error message on compiling Scala file and this is error I'm getting:
'The method size() is ambiguous for the type SortedSet'
There are this dependencies inside pom.xml file:
<org.scala-lang>2.13.0</org.scala-lang>
<com.typesafe.akka>2.6.18</com.typesafe.akka>
<com.lightbend.akka>1.0.7</com.lightbend.akka>
Project is using Java OpenJdk 1_8_u333.
Does anyone know how to resolve it?
I've been looking and found there was bug in Eclipse with ambiguous method calls which seems still present:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=468276
I've tried to avoid it by adding this parameter to eclipse.ini file, but it doesn't work:
-DtolerateIllegalAmbiguousVarargsInvocation=true
Error doesn't occur when I change compiler to Java 7, but I can't avoid this error ... the second way to avoid it is to call exact method name iterator().size()
Note: I tried same code in IntelliJ with same JDK and there was any errors ... any suggestion would be very helpful.
Thanks in advance!

Related

Error on Intellij Idea when trying to run a kotlin project

Im getting this error. What I was doing was the code I want to run didnt run rather it showed up the Edit Configurations
The error: Failed to download Amazon Corretto 18.0.2. EventQueue.isDispatchThread()=false Current thread: Thread[ApplicationImpl pooled thread 110,4,main] 2031890033 SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 1808191328
This was what I was trying to fix: Image Cannot access 'java.io.Serializable' which is a supertype of 'kotlin.Array'. Check your module classpath for missing or conflicting dependencies
And it says that the JDK "corretto-18" is not found on the disk or corrupted.
Im using: IntelliJ up to date, Java 18
Does anyone has a solution for this issue??
Thanks-

error occurred "java: cannot access java.util.function.Function class file for java.util.function.Function not found " in selenium

I am having the above issue once am running the code. I have changed my language level into 8 and added maven properties into the POM file. But still having this issue. Please help me to resolve this.
Yes as like above comment it's quite difficult to solve problem without any error log or code so if possible please add it.
Else where as per my experience i thought that it's occurred in case where your JDK dependency not bind properly with your project.
In such case you're not able to use that library inside your project. For that go inside "Project settings" inside your IDE and check dependency bind properly(like following image) or not if not then do it first.

Strange Error, I think it's related to eclipse

I am getting the following compiler error on the package:
package com.core.cronjob.mapping;
The Error :
Internal compiler error: java.lang.IllegalArgumentException: info
cannot be null at
org.eclipse.jdt.internal.compiler.codegen.StackMapFrame.addStackItem(StackMapFrame.java:81)
I don't think it's the code.
I'm using Ant 1.9.4 to build the project and Eclipse Mars.1 Release .
(4.5.1)
The compiler version is : javac 1.7.0_79
Was anyone encountered this error before?
Thanks
As stated in the comment, it's indeed an Eclipse bug, recurrent since Eclipse 3.X.
The last time I encountered this one it was fix with an Eclipse upgrade but since you're already up to date; you may try to downgrade to Luna (4.4) ? or wait for Eclipse to fix this one in a new RC..
As far as I know there is no workaround (Uninstall/Reinstall might also do some good..)
I know this is a older post, however, I did experience this using IntelliJ SpringBoot project on a Junit/Mockito test class.
With the help from smarter and more experienced Java guru's, they helped me resolve the issue.
We had to comment out all the code in the class and un-comment out sections until we found the statement causing the error.
It was this setId(configId++), we tried ++configId with no success. We then realized the class member variable is a 'Long' and the local variable is a 'long'.
Change the local to 'Long' and it compiled.
1. ERROR in C:\JenkinsJAAS\workspace\ohsu\woa-ohsu-parent\master\di-config-ohsu\di-config-service-impl-ohsu\src\test\java\com.ge.ps.diconfig.data.impl\ConfigDataServiceImplTest.java (at line 0)
/*
^
Internal compiler error: java.lang.IllegalArgumentException: info cannot be null at org.eclipse.jdt.internal.compiler.codegen.StackMapFrame.addStackItem(StackMapFrame.java:81)
----------
info cannot be null

fbconnect in android to publish comments on user wall

I followed the steps in http://www.mobisoftinfotech.com/blog/android/845/ but fbconnect API is a Java project but using Android package so its throwing error. So can anyone help me to complete this?
java.lang.enum
Description The type java.lang.Enum cannot be resolved. It is indirectly referenced from required .class files
Resource FBLoginButton.java
Path /fbconnect-android/src/com/codecarpet/fbconnect
Location line 1
Type Java Problem
There still doesn't seem to be enough information but it seems like your problem might be related to your configuration in Eclipse (if you're using Eclipse of course).
These answers might help figure it out:
Can not compile enums in Eclipse
Android: The type java.lang.Enum cannot be resolved

Eclipse ClassNotFoundException

Everything works fined, but suddenly eclipse stopped execute and junit tests or even main method, when i run them using run as - > Java application, run as -> junit test
It simply throws error
Caused by: java.lang.ClassNotFoundException: package.ClassName
whene ClassName - is class from where i trying to run method main.
It affect only one of my projects ... Different workspaces works fine, other project in same workspace works fine as well.
I'm sure if i recreate current project, error will gone. But the adjustments of this project in eclipse is really hard, so i want to avoid it.
Any clue?
The ClassName is not in the Class Path, if you start from console you should use -cp parameter , if from eclipse, please add ClassName to the sources of current(start) project.
Thanks to adarshr, I was able to look at the Problems window and determine that the build was failing because it could not find a class I had written.
I had used the MS TFS plugin to create a "shelveset" and it was supposed to have removed my pending changes in the process. However, this integration with the TFS snapin and Eclipse is obviously not well implemented, since the Eclipse project still thought the file existed and was complaining that it could not be compiled.
I went and manually deleted those "files" or "non-existing files" from the Eclipse project (that I thought I had removed with the shelveset action) and the problem was solved.
Also....
Another annoying things is that the Tomcat error I was getting by trying to debug within Eclipse was like this:
SEVERE: Error configuring application listener of class
com.CompanyName.ProjectName.servlet.StartupConfigListener
java.lang.ClassNotFoundException:
com.CompanyName.ProjectName.servlet.StartupConfigListener at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
In reality, there was no problem at all with StartupConfigListener.java!! The build failed due to the OTHER problems I mentioned above, and therefore I guess this was the first class it attempted to load and failed.... because the entire project hadn't been able to compile perhaps?
(Here's to hoping my next project is using Visual Studio instead of Eclipse!)
Ok, I finally figured it out. The problem was with installed JRE in eclipse setting. I was playing around with this setting and changed installed JRE to JDK, and for some reason it broke the eclipse project.
You can also try going back to the basics. Check your command line and VM args. I've had this situation where a VM arg I was passing in was a path to a file that had a space in the path, and I had forgotten to include the full path in quotes. So e.g., if my arg looked something like
-DFILE=C:\Documents and Settings\myfile
...I'd get a java.lang.NoClassDefFoundError caused by a java.lang.ClassNotFoundException.

Categories