Setting up IntelliJ IDEA Ultimate for Scala/SBT - java

I' ve been struggling with setting up IntelliJ IDEA Ultimate for use with Scala/SBT for the past couple of hours and currently i am facing an error that i dont even know how to look up properly. Googleing the error code didnt help unfortunately :(.
So, everytime i set up a new project or import an existing one, following the instructions found here:
https://scala-lang.org/documentation/getting-started-intellij-track/building-a-scala-project-with-intellij-and-sbt.html
and
https://www.jetbrains.com/help/idea/creating-and-running-your-scala-application.html
i am getting the following error msg as soon as the project has finished loading:
Error:Error while importing SBT project:...[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:118)
[error] at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2353)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error] at sbt.std.Transform$$anon$4.work(System.scala:64)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:266)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
[error] at java.base/java.lang.Thread.run(Thread.java:844)
[error] (*:update) sbt.librarymanagement.ResolveException: download failed: org.apache.logging.log4j#log4j-core;2.8.1!log4j-core.jar(test-jar)
Invalid response.See complete log in file:/home/a0947188/.IntelliJIdea2017.2/system/log/sbt.last.log
I have properly installed SBT 1.0.3 and the scala plugin 2.1.14.
Do you have any idea what i can do about this? I need to hand in the project in 2 weeks and our teacher specifically requires us to use IntelliJ IDEA.

Lorenz I had exactly the same problem.
When reading the whole error message i found https://dl.bintray.com/sbt/sbt-plugin-releases/org.apache.logging.log4j where sbt seems to search for an update, but it is not available.
My solution was, to use older SBT and Scala plugins:
I'm now using SBT 0.13.13 and Scala 2.12.0 and everything is working fine so far. (JDK version should be 1.8)
I hope it will work for you too.

Related

java.lang.UnsatisfiedLinkError when starting the play project

Im trying to start a project on play in IntelliJ IDEA Ultimate MacBook Pro on M1, I get the following error in the console:
[error] java.lang.UnsatisfiedLinkError:
/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp:
dlopen(/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp,
0x0001): tried:
'/Users/username/Library/Caches/JNA/temp/jna2878211531869408345.tmp'
(fat file, but missing compatible architecture (have 'i386,x86_64',
need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
I tried to reinstall the JDK on the arm architecture after deleting all the JDKs, it did not help
What needs to be tricked to fix this?
Full StackTrace:
[error] java.lang.UnsatisfiedLinkError: /Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
[error] at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
[error] at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
[error] at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2627)
[error] at java.base/java.lang.Runtime.load0(Runtime.java:768)
[error] at java.base/java.lang.System.load(System.java:1837)
[error] at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
[error] at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
[error] at com.sun.jna.Native.<clinit>(Native.java:195)
[error] at io.methvin.watchservice.jna.CarbonAPI.<clinit>(CarbonAPI.java:19)
[error] at io.methvin.watchservice.jna.CFStringRef.toCFString(CFStringRef.java:23)
[error] at io.methvin.watchservice.MacOSXListeningWatchService.register(MacOSXListeningWatchService.java:101)
[error] at io.methvin.watchservice.WatchablePath.register(WatchablePath.java:50)
[error] at io.methvin.watcher.DirectoryWatcher.register(DirectoryWatcher.java:352)
[error] at io.methvin.watcher.DirectoryWatcher.registerAll(DirectoryWatcher.java:317)
[error] at io.methvin.watcher.DirectoryWatcher.<init>(DirectoryWatcher.java:167)
[error] at io.methvin.watcher.DirectoryWatcher$Builder.build(DirectoryWatcher.java:118)
[error] at play.dev.filewatch.DefaultFileWatchService.watch(DefaultFileWatchService.scala:38)
[error] at play.dev.filewatch.FileWatchService$$anon$1.watch(FileWatchService.scala:87)
[error] at play.runsupport.Reloader.<init>(Reloader.scala:414)
[error] at play.runsupport.Reloader$.reloader$lzycompute$1(Reloader.scala:259)
[error] at play.runsupport.Reloader$.play$runsupport$Reloader$$reloader$1(Reloader.scala:251)
[error] at play.runsupport.Reloader$.startDevMode(Reloader.scala:271)
[error] at play.sbt.run.PlayRun$.devModeServer$lzycompute$1(PlayRun.scala:99)
[error] at play.sbt.run.PlayRun$.devModeServer$1(PlayRun.scala:83)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3(PlayRun.scala:106)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3$adapted(PlayRun.scala:68)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] stack trace is suppressed; run 'last Compile / run' for the full output
[error] (Compile / run) java.lang.UnsatisfiedLinkError: /Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp: dlopen(/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp, 0x0001): tried: '/Users/romangoltsov/Library/Caches/JNA/temp/jna2878211531869408345.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/jna2878211531869408345.tmp' (no such file)
Found a solution:
Inside sbt 1.4.6 there is a JNA library version 5.5.0, which apparently does not have the necessary files for the arm64 architecture processor
Raising the sbt version to 1.6.2 helped

How to deploy spring boot to heroku?

I wanted to deploy my application to heroku server and I am facing this problem. Any idea?
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.339 s
[INFO] Finished at: 2021-08-09T04:05:01Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project russion_spring_boot: Fatal error compiling: invalid target release: 11 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
<properties>
<java.version>15.0.1</java.version>
</properties>
Logs depict the error - invalid target release: 11. Basically this error means that you have mentioned higher/mismatched version of Java in maven compiler's source and target java version settings in your pom.xml compared to the JDK which is being pointed out by JAVA_HOME environment variable.
To fix this error, just check the Java version in pom.xml and JAVA_HOME. They should match.
To know more about this issue, check this post - https://dzone.com/articles/how-to-fix-invalid-target-release-17-18-19-or-110

Appcelerator titanium crashes building java files for my android project

My project was compiled successfully 3 weeks ago. I'm avoiding to update appcelerator components because certain modules of my project need that specific version.
I'm not update Java (1.8 131) neither the appcelerator cli or sdk since 3 weeks ago. The SDK version i am using is 6.0.2.
I can't undestand why titanium is showing this errors now in the "building Java source files" stage:
[INFO] Building Java source files: /usr/lib/jvm/java-8-oracle/bin/javac "-J-Xmx1024M" "-encoding" "utf8" "-bootclasspath" "/home/user/android-sdk/platforms/android-23/android.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/kroll-v8.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-analytics.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/aps-analytics.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-android.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/jaxen-1.1.1.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/ti-commons-codec-1.3.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/kroll-common.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/titanium.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/android-support-multidex.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-filesystem.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-app.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-ui.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/nineoldandroids-appc-2.4.0.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-media.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-appcompat.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/android-support-v4.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/android-support-v7-appcompat.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-cardview.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/cardview-v7-23.0.1.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-locale.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-network.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-xml.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-map.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-calendar.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-geolocation.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-database.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-accelerometer.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-platform.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-contacts.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-gesture.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/modules/titanium-utils.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.map/3.1.1/map.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.map/3.1.1/lib/google-play-services-gcm+maps.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.imagefactory/3.0.0/imagefactory.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.goosh/2.0.5/ti.goosh.jar:/home/user/Appcelerator_Studio_Workspace/myproject/modules/android/ti.goosh/2.0.5/lib/gson.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/kroll-apt.jar:/home/user/.titanium/mobilesdk/linux/6.0.2.GA/android/lib/titanium-verify.jar:Manifest.class:R.class:AssetCryptImpl.class:FixioActivity.class:FixioAppInfo.class:FixioApplication.class" "-d" "/home/user/Appcelerator_Studio_Workspace/myproject/build/android/bin/classes" "-proc:none" "-target" "1.6" "-source" "1.6" "#/home/user/Appcelerator_Studio_Workspace/myproject/build/android/java-sources.txt"
[ERROR] Failed to compile Java source files:
[ERROR]
[ERROR] /home/user/Appcelerator_Studio_Workspace/myproject/build/android/gen/es/myproject/AssetCryptImpl.java:44: error: cannot find symbol
[ERROR] Range range = assets.get(path);
[ERROR] ^
[ERROR] symbol: variable assets
[ERROR] location: class AssetCryptImpl
[ERROR] /home/user/Appcelerator_Studio_Workspace/myproject/build/android/gen/es/myproject/AssetCryptImpl.java:48: error: cannot find symbol
[ERROR] return new String(filterDataInRange(assetsBytes, range.offset, range.length));
[ERROR] ^
[ERROR] symbol: variable assetsBytes
[ERROR] location: class AssetCryptImpl
[ERROR] Note: /home/user/Appcelerator_Studio_Workspace/myproject/build/android/gen/es/fixio/AssetCryptImpl.java uses unchecked or unsafe operations.
[ERROR] Note: Recompile with -Xlint:unchecked for details.
[ERROR] 2 errors
Thanks in advance for your help and sorry for my bad English.
UPDATE (2017-07-05):
I found this appcelerator jira with the same problem:
https://jira.appcelerator.org/browse/TIMOB-24895
I'm waiting for a official workarround.
Have you tried cleaning the project directory before compiling? If you're using studio, just go to Project/Clean in the menu and select your project, or you can use the command line tools (http://docs.appcelerator.com/platform/latest/#!/guide/Titanium_CLI_Tasks-section-src-38931164_TitaniumCLITasks-CleanYourBuildFolder)
Apparently the problem is version 4.4.0-81 of my linux kernel (Ubuntu 16.04). At the moment, my solution has been to start up with version 4.4.0-79 in order to compile as usually.

bad symbolic reference. A signature in WebUI.class refers to term eclipse in package org which is not available

I am building my spark environment, refering to http://spark.apache.org/docs/latest/building-spark.html#spark-tests-in-maven. But when i use this command: "mvn -Pyarn -Phadoop-2.3 -DskipTests -Phive -Phive-thriftserver clean package", I met some errors.
[error] bad symbolic reference. A signature in WebUI.class refers to term eclipse
[error] in package org which is not available.
[error] It may be completely missing from the current classpath, or the version on
[error] the classpath might be incompatible with the version used when compiling WebUI.class.
[error] bad symbolic reference. A signature in WebUI.class refers to term jetty
[error] in value org.eclipse which is not available.
[error] It may be completely missing from the current classpath, or the version on
[error] the classpath might be incompatible with the version used when compiling WebUI.class.
[error]
[error] while compiling: /download_wlh/spark-1.6.0/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala
[error] during phase: erasure
[error] library version: version 2.10.5
[error] compiler version: version 2.10.5
There is somebody ask a question which is similar to this. Refering to strange error message: bad symbolic reference. A signature in package.class refers to term apache in package org which is not available
But there are no solutions mentioned.
I ran into the same problem as you trying to make a Spark distribution with Hadoop 2.4 using Java 8 and Scala 2.11.
My original attempt was: ./make-distribution.sh --name hadoop-2.4-custom --tgz -Phadoop-2.4 -Dscala-2.11
This produced the error described in Spark SQL 1.5 build failure
Following the advice from that post, I ran ./dev/change-version-to-2.11.sh and then omitted the -Dscala-2.11 as one of the comments suggested. This yielded your exact error. When I added the scala flag back in, the build passed. In summary, I fixed all my problems with:
./dev/change-version-to-2.11.sh
./make-distribution.sh --name hadoop-2.4-custom --tgz -Phadoop-2.4 -Dscala-2.11

Unable to stream twitter data using storm

I am following the steps as per the Kantega/storm-twitter-workshop project link
but I am stuck at a point. While testing credentials by running the main class in folder cheating
cd cheating
mvn compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=storm.starter.CheatingTwitterFunTopology
I am getting the below error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project storm-assignment-solution: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] /usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Where am I going wrong?
The Error says it all ..
[ERROR] Unable to locate the Javac Compiler in:[ERROR] /usr/lib/jvm/java-7-openjdk-amd64/jre/../lib/tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
Looking at your project page found the following
1) It uses 2 maven modules namely cheating and storm-assignment and both of them are expected to run under Java 1.6 as found in their pom.xml
Check the pom.xml for both the module has this
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
Make sure you are running with atleast Java 1.6 or Higher

Categories