error running scala on Netbeans V.7.4 - scala

I have trouble while trying to compile and run a scala program using Netbeans IDE 7.4
log error below this :
Compiling 1 source file to F:\Bahasa_Scala\2016\Juni\ScalaApplication2\build\classes
F:\Bahasa_Scala\2016\Juni\ScalaApplication2\nbproject\build-impl.xml:405: The following error occurred while executing this line:
F:\Bahasa_Scala\2016\Juni\ScalaApplication2\nbproject\build-impl.xml:238: bad option: '-make:transitive'
BUILD FAILED (total time: 0 seconds)
I have searched and followed the instruction from here help1 but it's still not working for me.
source/binary format is JDK 8.
any suggestion?
thanks

the solutions right below this :
open F:\Bahasa_Scala\2016\Juni\ScalaApplication2\nbproject\build-impl.xml:238 (on line 1)
after that remove -make:transitivie and then the code would be (on line 3)
after that, clean and build and run. happy coding scala, guys!
code link here

Related

Getting error in Gatling -> java.lang.ClassNotFoundException: nextgen.SetUpApplyFlowAndLottery

I am trying to upgrade from Gatling 3.5 to 3.7. I think I already did it
My steps to do the upgrade:
1- Changed some values in the pom.xml
2- Ran the command → mvn clean install
I did not get any error and my pom.xml now looks like:
I am running the following command to run a Gatling script that was working in version 3.5:
but now I get the following error
For privacy policies in my company i cannot share the fully script but this is the beginning
Why am i getting this error ? did i do something wrong in the upgrade ? do i have to add something else in the pom.xml file ? do i have to check something else ?
Again, i did not touch the script and it was working in version 3.5

Why am I getting errors after initialization in Intellij IDEA sbt shell?

I'm having issues with the SBT shell in the Intellij IDEA.
I am running Windows 10 and have the latest versions of Scala, Intellij and SBT installed on my machine.
I created a small sample project called "Hello World."
When I open the "sbt shell" I get the following prompt in green:
(initalizing) >
I then get the following initialization messages:
After which I just see the ">" prompt in green.
If I try to run a simple command such as "sbtversion" I get an error saying unknown command.
It looks like the sbtshell never finishes initialization for some reason?
What is going on here?
What am I doing wrong?
Am I missing a step somewhere?
Thanks
SBT is case sensitive.; Try using sbtVersion instead of sbtversion.
Your shell seems to be fully initialized: the new lined
>
is Intellij's way of interacting with the shell prompt.

Scala project using sbt throws NullPointerException

I cloned the project from here, and tried to load it in Terminal by opening the directory and using the command sbt. But this shows error like this:
java.lang.NullPointerException
at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1769)
at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
at java.base/java.util.regex.Pattern.matcher(Pattern.java:1130)
at java.base/java.util.regex.Pattern.split(Pattern.java:1249)
at java.base/java.util.regex.Pattern.split(Pattern.java:1322)
at sbt.IO$.pathSplit(IO.scala:797)
at sbt.IO$.parseClasspath(IO.scala:912)
at sbt.compiler.CompilerArguments.extClasspath(CompilerArguments.scala:66)
...
...
I tried another project, pdffigures2. It shows similar error:
[info] Loading project definition from /path/to/project/pdffigures2/project
java.lang.NullPointerException
at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1769)
at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
at java.base/java.util.regex.Pattern.matcher(Pattern.java:1130)
at java.base/java.util.regex.Pattern.split(Pattern.java:1249)
at java.base/java.util.regex.Pattern.split(Pattern.java:1322)
at sbt.IO$.pathSplit(IO.scala:744)
at sbt.IO$.parseClasspath(IO.scala:859)
at sbt.compiler.CompilerArguments.extClasspath(CompilerArguments.scala:62)
at sbt.compiler.MixedAnalyzingCompiler$.withBootclasspath(MixedAnalyzingCompiler.scala:189)
...
...
and prompts me to retry, quit, last or ignore. I tried again, only to get the same result.
If it may help, I'm using Ubuntu 18.04.
I had java version 10.x and javac version 1.8x. I downgraded java version to 8, and the problem seems to have fixed

Setting up LWJGL 3.0 with Netbeans

Downloaded LWJGL 3.0 from lwjgl.org, which only had the lwjgl.jar file in the jar subdirectory. The native directory only has files like libglfw.so but no subdirectories at all (and certainly not native/windows).
Created a library LWJGL30 with the lwjgl.jar file.
Added it to my project's library. and to the Project Properties->Libraries->Compile and Run.
Set the JVM launch argument in Project Properties->Run to -Djava.library.path=C:\Users\Owner\Documents\lwjgl\native for the VM Options
Copied the HelloWorld example from the link
Then ran and I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not
initialize class org.lwjgl.system.Library at
org.lwjgl.system.MemoryAccess.(MemoryAccess.java:22) at
org.lwjgl.system.Pointer.(Pointer.java:22) at
org.lwjgl.glfw.GLFW.(GLFW.java:594) at
mylwjgl.MyLWJGL.run(MyLWJGL.java:43) at
mylwjgl.MyLWJGL.main(MyLWJGL.java:140)
C:\Users\Owner\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53:
Java returned: 1 BUILD FAILED (total time: 7 seconds)
I have checked, double checked, triple checked as well as searching online for an answer as it should work but it does not. Any help would be appreciated.
This error occurs when LWJGL is unable to find the native files. Make sure java.library.path actually points to the directory with LWJGL's natives (which have extensions like .dll, .so and .dylib). Be careful with spaces in the path: You have to wrap the path in quotation marks or it won't work.
The issue was I was running the HelloWorld example using the Stable version of LWJGL 3.0. When I switched to the Latest version, everything worked as expected.

noClassDefFoundError using Scala Plugin for Eclipse

I successfully implemented and ran several Scala tutorials in Eclipse using the Scala plugin. Then suddenly I tried to compile and run an example, and this error came up:
Exception in thread "main" java.lang.NoClassDefFoundError: hello/HelloWorld
Caused by: java.lang.ClassNotFoundException: hello.HelloWorld
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
After this point I could no longer run any Scala programs in Eclipse. I tried cleaning and rebuilding my project, closing and reopening my project, and closing and reopening Eclipse.
Eclipse version number 3.5.2 and Scala plugin 2.8.0
Here is the original code:
package hello
object HelloWorld {
def main(args: Array[String]){
println("hello world")
}
}
If you see this when you attempt to run as a Scala application then the most likely explanation is that your project didn't compile and no class files were generated. Please check whether or not that's the case: look in your project's output folder for hello/HelloWorld.class.
If your project didn't compile that could either be because there's an error which you've missed (and if this error isn't being reported in the Problems view that could be a bug, in which case please open a ticket on Trac) or because you've turned off automatic builds and not done a manual build of your project.
I had the same problem. Project doesn't compile but there are no errors highlighted and AFAIK the code is OK. It seems to be a problem with the Run Configurations.
Solution 1: Delete the existing Run Configuration for your object and create a new one
Solution 2: Create a new object and cut / paste all your code into that file
When running "clean" does not un-hose Eclipse, I next try saving my work, exiting Eclipse, and re-starting. That usually gets things going again, but not always. A few times I've had to update the Scala plugin with a more recent version (I'm using the latest nightly), to get things working again. I doubt that this worked because the new plugin happened to fix the bug, but rather expect that loading the new plugin gives the whole Eclipse-Scala
system a "total reset" that gets it unhosed.
I was getting this problem in a project that combined .java & .scala files.
The solution for me was:
Remove all .java files
Edit the scala code as needed so it compiles without them.
Add the .java files back in.
Edit the scala code back.
The other solutions given here didn't work for me. I tried: clean project, restarting Eclipse, closing-&-opening the project, creating a new .scala file. No joy.
I'm using Eclipse 3.7 (latest stable), Scala IDE 2.0.0 and Scala 2.9 on Ubuntu Linux 11.10.
The symptoms in my case were:
My project was working, but then it stopped compiling for no apparent reason. The IDE didn't show any compilation errors for .scala files, but there were no .class files in the output directory & I got a NoClassDefError if I tried to run anything.
If I created a deliberate error in a .scala file, that did get picked up as a compilation error.
The .java files were registering errors due to the missing scala classes.
I suppose there's probably a boot-strapping bug somewhere in the IDE plugin for .java/.scala mixes. I've done hybrid projects with this setup without problems, so it's only triggered in some situations. I don't know what the trigger is, but once triggered, there's no nice solution.
I had moved my one and only class/object/application to a package, but had not added the package declaration.
sbt compiled and ran fine; eclipse would not
Adding the package declaration at the top of the file fixed it.
Scala 2.8.3 plugin; no compile error
I encountered this error too but after doing the suggestions here (cleaning, deleting Run Configuration etc), I realized that I set the workspace wrongly that is why the class is not being found.
An indication that this is a problem is when the same error occurs when you try to compile a java project.
I encountered this error (compilation worked in sbt but failed in eclipse) when I created a new package object called "common". Deleting the package object in eclipse caused the compile error to go away. There was nothing in it.
I was using sbt-eclipse to build the eclipse project. I'm using scala eclipse 3.0.0-vfinal-20130326-1146-Typesafe.