jdk-11, Eclipse Photon 18-9, windows 7, Error free Application ported from java 6 until java 8. Just trying how far jdk-11 is usable with Eclipse.
JAVA_HOME points to jdk-11. Eclipse starts! But then things go strange. It’s possible to set the Java Build Path to jdk-11. But even if forced to be under Classpath the jre changes self to Modulepath!
The compiler compliance level can be set up to Java 10!
Under project Facets the highest Version of java which can be chosen is 9! If the compliance level of java is not reduced to 9, Java version mismatch is signaled!
Building with eclipse generates the mentioned false Error in 100 of cases!
However compiling with maven, source and target set to java 11, the package build terminates with success even if compiling for jee 8.
Who knows more about that? Anyway I’ll switch back to Java 8. Conclusion after a year of new Java versions coming out, it’s still not possible to use them! Very strange.
I just encountered this same issue, what i did to fix it was i just cut out that segment of code and pasted it back in and then it worked like it was supposed to. It can be caused by a small bug in the compiler. It stumped me for about an hour, but I got it! Otherwise, if you right click the project folder and go to properties, then compiler, you can change the compliance level to 11. this prevented the error from appearing a second time.
I was able to fix the issue by explicitly importing the hidden type:
import java.lang.Integer;
Note: before that I tried with
> Menu > Project > Clean
which seemed to work. That fix was only temporary however.
I had the same problem in Eclipse. However, the only thing that fixed it was changing the JRE from 10 to 11. So yes, it was a compatibility issue. I tried "Java.Lang.Integer" but like mentioned before, it was only temporary (which made NO sense to me since we are dealing with a type "String" lol).
Screenshot
Screenshot
Related
I'm working with a Scala project and am trying to get IntelliJ to work with it. (If it makes a difference, I've gotten it to work before. But my machine died and had to be replaced, and this is the first time I've tried to use Scala since reinstalling IntelliJ on the new machine.) The machine is running Linux.
I've gotten the banner that says "No Scala SDK in module", and I selected "Setup Scala SDK"; Create; Download; Version 2.11.11; OK. But I get the message
Cannot run program "java" (in directory "/tmp/sbt-project"): error=2,
No such file or directory
Why is it looking in that directory (which does not exist on my machine)? It's possible there are some settings that got copied over from my previous machine. If so, where would I find and fix the setting?
How do I get past this problem?
Note: In a desperate attempt to work around the error, I created /tmp/sbt-project and symlinked the Java binaries into it. When I tried again, I got the same error except it said in directory "/tmp/sbt-project1". I tried creating /tmp/sbt-project1 as a symlink, and when I retried, it said in directory "/tmp/sbt-project2". What's going on?
In short: I have no idea why you and I both experienced this problem, but these steps remedied the situation for my particular case (no guarantees but maybe it will help you too)
Close Intellij
Likely in your home directory, backup and remove the .Idea* directory containing your personal settings
Open Intellij and at the welcome screen choose Do not import settings
Using the guided installation, ensure the "Featured" plugin, Scala, is installed
Reopen your project and when you setup the Scala SDK, miraculously a pre-existing version of Scala SDK should exist from the "Ivy" repository (I tested this on a fresh VM of Lubuntu)
After selecting the (likely outdated) Scala SDK, again go to Project Settings and under Global Libraries click the + symbol to add the latest Scala SDK.
Miraculously once again, you will see now both the SDK version from before and the latest version of Scala - choose that one and done!
Notes:
Before running those above steps, I tried the same things you did on the VM, possibly caching install versions I wasn't even aware of that later became available once I resetup Intellij.
The reason I suspect this worked is because I thought I would save myself time by copying the .Idea* directory from a different machine and using that - many paths were different! So likely I just disabled features with broken paths from my other machine
Even though I never needed to press the "Download" button, if I do I still get that same error! So I guess all this did was bypass manually downloading the SDK like you had to do...
My setup:
OS: Lubuntu-16.04.3-lts
Intellij Version:
IntelliJ IDEA 2018.1.4 (Community Edition)
Build #IC-181.5087.20, built on May 16, 2018
JRE: 1.8.0_152-release-1136-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.13.0-43-generic
echo $PATH
/home/e/tools/jdk1.8.0_121/bin:/home/e/bin:/home/e/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
I met the same problem when installing Scala by IntelliJ.
You can choose to install Scala mannually.
For example, install Scala follow this tutorial: https://www.vultr.com/docs/how-to-install-scala-on-centos-7
Then use Browse when selecting Scala SDK. Choose your directory, e.g. /usr/share/scala/
You can use Scala in IntelliJ now.
I am trying to compile a relatively simple, client-side-only GWT 2.5.0 application under JDK 7u7.
The project runs perfectly fine in development mode. I also remember it was compiling ok on another machine a while ago. (It had GWT 2.4 and some JDK 7, and I transfered my project to GWT 2.5 by creating brand new GWT project on new machine, and copying the old sources to the new src dir. I am sure everything went fine on this stage, as "development mode" runs ok, even after cleaning project/cache).
GWT Eclipse plugin is latest (installed from update site for my Indigo, yesterday).
I was trying with/without "-localWorkers 2", and also with different memory settings ("-Xmx512m", "-Xmx2048m"). I was trying different output styles (obfuscated, detailed) and different log levels (like it could change anything :)). I even tried "-draftCompile" - no success.
Anyway, in every case, the compilation stops after a few seconds with JVM crash report, on C functions like memcpy (!) or some JVM internal functions.
JVM trace file: http://pastebin.com/KzTrQqw7
GWT log on debug level: http://pastebin.com/yQZHi4Am
Any ideas why this could be happening to me?
Ok, it turns out that you can compile GWT with JDK7 only sometimes (I even tried creating a new, empty, sample project, the "GreetingService" one - it was crashing as well on my configuration).
But with JDK6 it goes nice, credits to Anders R. Bystrup.
I haven't used JDK 7, but I typically increase the JVM stack size to 4M
-Xss4M
I created a Google Web Toolkit project in Eclipse (Indigo, GWT 2.4, Linux Ubuntu), made some changes (mainly, renamed the default module and added a new module), then clicked "GWT Compile", and then nothing happened - the compilation just hanged forever. There is no output; the progress bar at the bottom right shows "0%".
When I use "loglevel=all", I get a single line of output "Checking for updates" and then it hangs.
I tried deleting the cache - no change.
I tried creating a new project and copying the source files - no change.
With the help of this link: http://comments.gmane.org/gmane.org.google.gwt/70561 I added "-XdisableUpdateCheck" to the compiler; now the compile completes, but, when I try to run in development mode ("Run as -> Web application") it says "Development mode is loading..." and hangs.
I don't know even how to start debugging this. Please give me some hint!
I faced the similar issue. Here is my sequence of events for it:
Checked out the GWT project from the SVN --> tried to Google-GWT Compile --> gave entry point modules --> my log level was info and output style Obfoscated -->Hit compile.. Nothing happens except the progress bar stuck at 0%.
Tried to google and find out the solution in multiple ways but couldn't get the proper answer.
One trick worked --> I deleted the project from the eclipse workspace and re-imported it from the disk as an existing project. GWT compile worked this time. :)
Why it worked? --> When we delete the project from eclipse workspace all the libraries associated with that project get unbound and removed from the classpath. When you again import the same project and try to compile GWT before adding the required libraries to the classpath it will works. The real conflict is with GWT libraries and JBoss 5.0 libraries. There looks like some plain bug in GWT2.4 which they need to resolve. In the classpath if you precede the jboss and Web App libraries prior to GWT library the compile gets stuck.
If you face the similar issue, remove jboss and web app libraries from the classpath and compile GWT module and then add those removed libraries sothat the JAva source from your project gets compiled. Good luck!
I was having the same problem after working through this tutorial: http://www.javacodegeeks.com/2010/12/securing-gwt-apps-with-spring-security.html
In the end it was a dodgy external JAR that I added to my build path (the spring-context one mentioned in the tutorial). I grabbed another copy of it and all is good now.
Here is the FIX for this one as we cannot continue with this whole business of taking the jBoss library in and out every time we need to compile GWT.
The problem is that com.google.gwt.dev.javac.JdtCompiler.getCompilerOptions
(JdtCompiler.java) is referring to CompilerOptions which, as fate would have it, is referencing to the implementation in jasper-jdt.jar (situated in jboss library) instead of gwt specific implementation. Get ride of this jasper-jdt.jar from jBoss library and you should be all set. Don't worry if you absolutely need any of the classes from jasper-jdt.jar; there are tons of alternative Jasper jars who can fulfill your need other than this one.
try this: right click->google->gwt compile->click advance (bottom) and
In the Additional compiler argument add this:
-XdisableUpdateCheck
Giving option -XdisableUpdateCheck to GWT Compiler solves the deadlock problem for me. Thanks for the hint.
Used GWT 2.5.0 with java :
$ java -version
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01, mixed mode)
$ cat /etc/issue
Fedora release 18 (Spherical Cow)
Kernel \r on an \m (\l)
$ uname -a
Linux myhostname 3.9.4-200.fc18.x86_64 #1 SMP Fri May 24 20:10:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
I could solve the problem by setting the optimization level (console Argument -optimize 8 to 8, which means optimize the code at most 8 times. Default is level 9 resulting in optimizing until nothing changes anymore. It seems there are a few cases where this results in an endless loop.
Also see this issue on GitHub:
https://github.com/gwtproject/gwt/issues/9452#issuecomment-259088434
Old question, but today a colleage of mine was just running into this issue, too. It turned out that he was using classes from client packages (both own classes and ...client.rpc.IsSerializable) within the shared package of his project.
As a result the GWT build froze at compiling permutation 0. I assume that it got trapped within an endless loop between compiling shared and client classes.
Removing all usages of client classes from shared classes helped.
I am working on an RCP project based on eclipse. It has been working fine but recently I thought I'd upgrade it to use a new eclipse version (3.2 -> 3.5).
After a bit of trouble, it was running on the new platform. Then I did something. Don't know what. The end result is that I'm now getting a classpath error when one of my plugins (A) tries to access a class in one of the dependent plugins (B) (also one of mine).
As far as I can see, Plugin A has Plugin B in its' dependency list and the compiler shows no errors. To test, I created a new Plugin C with one class and accessed the class from Plugin A. That works fine.
Does anyone have any hints for troubleshooting such issues? A checklist of settings to check? I've been struggling with this for hours and getting nowhere! Particularly frustrating as it was working until I changed something!
Thanks
Update
I should also say that the project is quite old and uses the plugin.xml and not the manifest. Could this be a problem? Is there a way to upgrade?
Some ideas:
Clean-and-build every project (maybe after a restart of Eclipse)
Check, whether the required packages are also exported
Check the Error log, maybe there is some unloadable plug-in, etc.
Check the Run configuration, whether every required plug-in is present there
If the problem does not happen in a Runtime workbench, but in an Exported RCP app, then check whether you compile the project with the same settings during export than in Eclipse
I hope, something helps about these.
You can try the following in your run configuration:
In the Main tab check Clear (workspace) under Workspace Data
In the Configuration tab check clear the configuration area before launching under Configuration Area
This helps me every time I encounter some strange ClassNotFound errors.
If I understand you correctly you have no compiler errors but when you run you get class not found exceptions? You could try PDE Tools > Update Classpath from the project's context menu to see if you declared any dependencies outside of the MANIFEST.MF file, which would result in compiling code that fails at runtime.
I developed for RCP quite a long ago, but if I'm not wrong, since 3.4 or 3.5 you have to declare in the plugin configration which packages/classes are exported for dependent plugins and which are not.
This is unlike the old convention of using 'internal' in the package to mark non-exported packages.
Since you have plugin.xml from very old version of eclipse, it might be the problem, as exported resources from one plugin to another were not enforced in Eclipse RCP 3.2.
One more complement, hope it helps.
Open plugin.xml, check "build" tab, see how "binary build" are configured. It affects which files will compiled and exported.
See binary build here : http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Feditors%2Fmanifest_editor%2Fbuild.htm
I recently gave up trying to use Scala in Eclipse (basic stuff like completion doesn't work). So now I'm trying IntelliJ. I'm not getting very far.
I've been able to edit programs (within syntax highlighting and completion... yay!). But I'm unable to run even the simplest "Hello World". This was the original error:
Scala signature Predef has wrong version
Expected 5.0
found: 4.1 in .... scala-library.jar
But that was yesterday with IDEA 9.0.1. See below...
UPDATE
Today I uninstalled IntelliJ 9.0.1, and installed 9.0.2 Early Availability, with the 4/14 stable version of the Scala plug-in.
Then I setup a project from scratch through the wizards:
new project from scratch
JDK is 1.6.u20
accept the default (project) instead of global / module
accept the download of Scala 2.8.0beta1 into project's lib folder
Created a new class:
object hello {
def main(args: Array[String]) {
println("hello: " + args);
}
}
For my efforts, I now have a brand-new error :)
Here it is:
Scalac internal error: class java.lang.ClassNotFoundException [java.net.URLClassLoader$1.run(URLClassLoader.java:202), java.security.AccessController.doPrivileged(Native Method), java.net.URLClassLoader.findClass(URLClassLoader.java:190), java.lang.ClassLoader.loadClass(ClassLoader.java:307), sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301), java.lang.ClassLoader.loadClass(ClassLoader.java:248), java.lang.Class.forName0(Native Method), java.lang.Class.forName(Class.java:169), org.jetbrains.plugins.scala.compiler.rt.ScalacRunner.main(ScalacRunner.java:72)]
FINAL UPDATE
I uninstalled 9.0.2 EA and reinstalled 9.0.1, but this time went with the 2.7.3 version of Scala rather than the default 2.7.6, because 2.7.3 is the one shown in the screen-shots at the IntelliJ website (I guess the screen-shots prove that they actually tested this version!). Now everything works!!!
I have encountered the same scalac error when trying to run a Scala project in Intellij Idea 9.0.2 and I've managed to find a solution by chance :). These are the steps I took in creating the project and running it.
I have created a Scala project in Intellij Idea 9.0.2 final (it was released today). I have installed the Scala plugin, restarted the IDE and created a new Scala project (with the name "TestScala") with scala-2.8.0.Beta1 as project library. Once the project is created and the scala libraries downloaded, I have created a Test.scala file with the following content:
object Test {
def main(args:Array[String]){
println("hello")
}
}
After that, I created a launch configuration ("Edit Configurations"), choosing the "Application" template. I set as main class Test and choose the project name ("TestScala") in the "Use classpath and JDK of module" combo box. When I run the configuration I get the same error as you reported ("Scalac internal error: class java.lang.ClassNotFoundException") .
Now comes the freaky part :). I right click on the project, choose "Module Settings", have a look on all settings but I don't change anything . Click "apply" and "ok", try to run configuration again and it works :) .
I use Intellij Idea 9.0.2 the final release (build 95-66); Ubuntu 9.10 and JDK 1.6.0_18. I also have to mention that I had a JDK configured in Intellij, otherwise there is an extra step to configure it.
UPDATE:
When checking the setting of the module, one needs to click on the Module->Scala and Facets->Scala (expand it and click on Scala(ProjectName)) . Both of these settings are about the scala compiler and scala library location. I would guess these values are not properly set when the project is created but are saved once the user touches them and saves the settings.
To answer your question, it's difficult to get a working IDE for Scala for two reasons:
(a) Scala is only just beginning to reach a wide audience and
(b) due to (a), there is no business case for spending time on a Scala IDE.
Also, if you are old enough to cast your mind back and young enough to still remember, you would know that for the first five or more years of Java, we were stuck with okay-ish tools like JBuilder that did little more than compile your code when you said so - no error highlighting, no auto-importing, and the word refactoring didn't even exist. If you want to pioneer, you need to be prepared to cut some of the road yourself, or at least bush-bash.
I know it won't help you, but I have successfully used IDEA for Scala on Linux, Mac and Windows. I typically have the Scala SDK installed somewhere locally and point IDEA at that rather than using the 'download' option.
Presently, I am mostly using an EAP version of IDEA 9 on Mac OS X with Scala 2.8.0.Beta1-RC5 and it's working well (except that fsc doesn't seem to worked with mixed sources).
You could try your luck over at the IDEA Scala Plugin Discussion Forum, though I haven't had a great lot of responses to my own postings there.
Installing the plug-in is prerequisite one.
The next thing you should do is define a library (global or project-specific; I use global) that holds the Scala library and compiler JAR files (at a minimum, that's scala-compiler.jar and scala-library.jar). Adding source JARs and a documentation JAR or URLs is a good idea, too. Then make this library a dependency of any modules in your project that include Scala code.
Lastly, find the Scala facets in those modules and de-select both check-boxes there.
I just did a fresh install and had exactly this same problem myself.
It turned out that, because I had created the file in the root package, IDEA had added a package statement at the top with naming a package. I assume that this then got compiled as "package object Main" - valid syntax in 2.8? Anyway, I deleted the line that said package and it all worked fine.
I had the same problem yesterday while trying to set it up. Solution is pretty simple, you just have to set scala somewhere in project settings.
You are mixing code compiled with two different Scala versions.
I use Netbeans to write scala programs. So far it works very well with my codes. You can try the plugin here: http://wiki.netbeans.org/Scala68v1.
I was getting this error and also had to right click on the project and "Open Module Settings". However, it was more than just hitting apply. I had to make sure that my Content Root was correct for each project. For some reason, there were some incorrect Source and Test Folders.
My project uses maven as the main build tool and importing the project into Intellij is probably what created these incorrect settings.
I had similar problem, following this blog post instructions solved the problem for me