Issue with installing SBT on Windows - java

I'm installing GIT/SBT/ETC on a new Windows 10 computer. I have installed GIT and SBT and Java JDK13. I also added the appropriate JAVA_HOME and PATH variables for java.
Now when I go to do "sbt -version" I get the following output. The first time I ran it after setting the path variables correctly it did a bunch of stuff but ended with this error. Now I only get the error when I run the version command.
$ sbt -version
error: error while loading package, Missing dependency 'object java.lang.Object in compiler mirror', required by C:\Users\WilliamWelch\.sbt\boot\scala-2.10.6\lib\scala-library.jar(scala/package.class)
error: error while loading package, Missing dependency 'object java.lang.Object in compiler mirror', required by C:\Users\WilliamWelch\.sbt\boot\scala-2.10.6\lib\scala-library.jar(scala/runtime/package.class)
sbt script version: 1.3.4
All my googling turns up using some portions of these errors is that I should use JDK 8 but that isn't even supported anymore (as evidenced by needing an account to download it) so I can't imagine whatever bug that was hasn't been fixed in SBT by now.
Any ideas?

Related

Can't get Coverity Scan to work (Java/Kotlin/Gradle 3.3 on Windows and Travis)

UPDATE: See the solution in Caleb's answer
I am trying really hard to make Coverity work for my build, but so far with little success.
First the details:
My project is run of the mill java library (no web or fancy containers), very few compile-only dependencies, built using Gradle
The production code is written in Java and Kotlin
The complete project is available on github: https://github.com/ddimtirov/nuggets
And on Coverity Scan: https://scan.coverity.com/projects/ddimtirov-nuggets?tab=project_settings
My development environment is Windows 10, Java 1.8.0_92, Gradle 3.3, CMD shell (though I also tried Cygwin and Mingw Bash)
there is also Travis build on Linux
I started by downloading a package from: https://scan.coverity.com/download/java/win64
Then I added the bin directory to my path, went to my project root and ran the following commands.
$ set PATH=%PATH%;C:\Users\dimit\sandbox\cov-analysis\bin
$ gradlew clean
$ cov-build --dir cov-int gradlew jar
The first 2 went as expected, the last - not so much:
Coverity Build Capture (32-bit) version 8.7.0 on Windows 10 Professional, 64-bit (build 14393)
Internal version numbers: b452b3f2c8 p-lodi-push-28091.612
The system cannot execute the specified program.
[WARNING] Build command gradlew.bat jar exited with code 1. Please verify that the build completed successfully.
[WARNING] No files were emitted. This may be due to a problem with your configuration
or because no files were actually compiled by your build command.
Please make sure you have configured the compilers actually used in the compilation.
For more details, please look at:
C:/Users/dimit/sandbox/nuggets/cov-int/build-log.txt
I have put the build log here: https://gist.github.com/ddimtirov/9daa0e9f1f0954453f01fcec42ae2198
The "Troubleshoot build failure" on the instructions page was pointing to a forum index page, which does not help at all: https://software-community-synopsys.force.com/s/#4838
Moving on, I thought that if I could only generate the data in some other way I could upload it to the scan service and bypass the problem. I found https://github.com/mjdetullio/gradle-coverity-plugin
The Gradle Coverity plugin emitted the data, but when I zipped it and uploaded to the scan service, it barfed the error email.
As last resort, I tried the TravisCI integration - after a few attempts, I got it to complete without an error, but it didn't seem to upload anything...
https://travis-ci.org/ddimtirov/nuggets/builds/196307253
https://scan.coverity.com/projects/ddimtirov-nuggets?tab=overview
I am close to giving up (BTW, not having docs available online doesn't help)
Issue 1 - "The system cannot execute the specified program."
This issue arose because a Windows 32-bit kit was used to attempt to capture a Windows 64-bit build. The attempt to attach a 32-bit process to a 64-bit one causes failure to execute.
The solution here is to match the bitness of Coverity binaries with the bitness of your platform (use a Windows 64-bit kit).
Issue 2 - Failure to capture TravisCI build on Linux
This issue appears to be due to an incompatibility between Coverity's Java Capture and the ErrorProne plugin, as evidenced by messages such as this one in the build log:
WARNING: Failed load class file java/io/FileNotFoundException.class as a resource using the class loader net.ltgt.gradle.errorprone.ErrorProneCompiler$SelfFirstClassLoader#36358417
The solution here is to disable that plugin for the Coverity build.
Varia
When debugging the issue, the known issue of the Gradle daemon interfering with Coverity was discussed, but was ultimately not relevant to the issue.
The noted issues with the "prepend" command are user error; the prepend command is not a separate command to run, it's there for utility purposes.
A few things to note, because reading our documentation is crucial to using our tool successfully:
Kotlin is not supported.
Using the appropriate binaries for your platform is required (so using win32 binaries on a 64 bit platform will generally not work).

Linking Matlab and Java: Library JMatLink.dll cannot be loaded

I want to use JMatLink to connect Java with Matlab. I need to use this specific library since it is integrated in the projeny code. I have followed the steps from the documentation / other forums:
downloaded the source code from sourceforge
unzipped it
copied the JMatLink.dll into C:\Windows\System32
added the path of matlab\bin and matlab\bin\win64 to my system environment variables
However, when I try to run the class SimpleGuiTest, I get the following error message:
ERROR: Could not load the JMatLink library
Win: This error occures, if the path to
MATLAB's <matlab>\bin directory is
not set properly.
Or if JMatLink.dll is not found.
Linux: Check if <matlab>/extern/lib/glnx86 (libeng.so, libmat.so, etc.)
and <matlab>/sys/os/glnx86 (libstdc++-libc6.1-2.so.3) are in your path.
(you can also copy missing libraries to your local path).
and
Exception in thread "main" java.lang.UnsatisfiedLinkError: jmatlink.CoreJMatLink.setDebugNATIVE(Z)V
I have changed the code where the library gets loaded from
System.loadLibrary("JMatLink");
To a command with absolute path
System.load("C:\\Windows\\System32\\JMatLink.dll");
But I am still getting the same error message. Is it possible that the .dll is not compatible with my Win 8.1 and Matlab R2014a environment? Do I have to compile a new one for my environment? Or is there anything else that I am missing?
I've also tried to install it without any luck a while back. I belive the reason is, as you state, that the .dll is not compatible with 64-bit operating systems/Matlab. If I remember correctly, a few of the dependencies it requires some 32-bit system libraries which was not found in my version of Windows 7 (64-bit). To map the missing dependencies I used dependencies-walker.
I had a go at compiling the source code as well, but you need to have an older version of Matlab6.5 (according to the build file) in order to compile it with the accompanying build file. More modern versions of Matlab such as 2014a does not have support for the aging borland compiler used by the build file. When trying to compile the library with Borland 5.5.1, MatlabR2012b, JavaSE1.4.2 it gives me the error:
compile:
[exec] Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
[exec] Error E2194: Could not find file 'Files\MATLAB\R2012b\extern\include.cpp'
[exec] Error E2194: Could not find file 'Files\MATLAB\R2012b\simulink\include.cpp'
It might be that you can find a way to build it with a modern supported compiler or if you get your hands on an older version of Matlab, but at this point I gave up that approached and created a wrapper using the matlabcontrol-fork matconsolectl.
Hope my experience has been helpful in some way.

"Unable to find a javac compiler" - while trying to generate an android app with RoboHelp 10

I am exploring a trial version of Adobe's Technical Communication Suite. Following this video, I am trying to generate an Android app using a sample document.
I've tried changing the file paths for the JDK and apache.ant files, but keep receiving the same error message (see below).
BUILD FAILED
C:\Program Files (x86)\Android\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:713: The following error occurred while executing this line:
C:\Program Files (x86)\Android\adt-bundle-windows-x86_64-20130522\sdk\tools\ant\build.xml:727: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files (x86)\Java\jre7"
I got the same error but in a linux system and solved it by knowing that: JDK is a super command for JRE.
JRE: Java Runtime Environment only runs not compile or build (eg. using ant).
JDK: compiles and runs.
So try changing your java setting to JAVA_HOME= ..../java OR .../jdk not .../jre.
It seems that you didn't configure your JAVA variable environment.
BTW, I don't know what IDE you are using. As far as I know, if you have more than one java versions in your computer, in eclipse you should set variables.
(1) window->preference-> left column (Java)->Compiler, you could change different compiler version.
(2) And in left column (Java) -> Installed JRE, you should also modify the JRE version.

Building older NetBeans project in bash leads to error

I am opening an older NetBeans project and I want to build it using ant in bash with debian. However, when I try to run ant, I get this error
BUILD FAILED
/home/karelbilek/NetBeansProjects/oldProject/nbproject/build-impl.xml:528:
The following error occurred while executing this line:
/home/karelbilek/NetBeansProjects/oldProject/nbproject/build-impl.xml:261:
Unable to find a javac compiler; com.sun.tools.javac.Main is not on
the classpath. Perhaps JAVA_HOME does not point to the JDK. It is
currently set to "/usr/lib/jvm/java-7-openjdk-i386/jre"
What does that mean? What should I do? In "/usr/lib/jvm/java-7-openjdk-i386/jre" there seems to be an actual JRE when I look there, so what is the problem?
You're pointing to a JRE (Java runtime environment) but not a JDK (Java development kit).
Only the JDK contains the compiler (javac). The JRE is used for running Java programs but doesn't carry the extra components of the JDK (compiler etc.)
it happened for me and i got through it by installing the jdk
sudo apt-get install openjdk-7-jdk
After installing jdk, the classpath executed right

compiling code in netbeans

I installed Java, but for some reason NetBeans wont compile my code, I am getting error:
C:\Users\Jay\Desktop\Key Stroke Project\nbproject\build-impl.xml:609: The following error occurred while executing this line:
C:\Users\Jay\Desktop\Key Stroke Project\nbproject\build-impl.xml:250: Error running ${platform.javac} compiler
Any ideas?
The line is:
target="${javac.target}" tempdir="${java.io.tmpdir}">
Open a command shell and type javac -version. You should see the version of Java you installed echoed back.
If the operating system complains about not being able to find the javac.exe command, then you need to add JAVA_HOME/bin to your PATH.
If you don't have a JAVA_HOME/bin, then perhaps you installed the JRE instead of JDK by mistake.
You may need to tell NetBeans how to find Java as well. I'm an IntelliJ user, so I can't be of much help there.

Categories