How to configure buckminster to not use default JDK to compile during build? - eclipse

I'm creating a build job on jenkins, the main part of it is a buckminster launch:
The job requires Java 1.8 and it's integrated JavaFX. The servers JAVA_HOME points to a Java 1.7 and all other jobs use that JDK.
So I configured a 1.8 JDK in the Jenkins system configuration and added it to the specific job:
Now when I run the job I get the following log (anonymised):
$ C:/Progra~1/Java/jdk1.8.0_40\bin\java.exe -Dbuckminster.output.root=PATH_TO_OUTPUT\buckminster.output -Dbuckminster.temp.root=PATH_TO_TEMP\buckminster.temp -Dworkspace=PATH_TO_WORKSPACE -Dqualifier=${QUALIFIER} -Xmx1024m -XX:MaxPermSize=128m -jar PATH_TO_BUCKMINSTER\buckminster4.4.0\buckminster\plugins\org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -application org.eclipse.buckminster.cmdline.headless -data PATH_TO_WORKSPACE --loglevel info -S PATH_TO_COMMANDS\commands.txt
INFO: setpref 'targetPlatformPath=PATH_TO_TARGETPLATFORM/targetPlatform'
INFO: import 'PATH_TO_CQUERY/site.cquery'
INFO: Import complete.
INFO: build
Error: file PATH_TO_CLASS\TargetController.java, line 11: The import javafx cannot be resolved
... lot more of there errors
Warning: file PATH_TO_MANIFEST\META-INF\MANIFEST.MF, line 98: The JRE container on the classpath is not a perfect match to the 'JavaSE-1.8' execution environment
So this indicates that the "build" is not using the configured JDK 1.8 eventhough it is beeing started with "C:/Progra~1/Java/jdk1.8.0_40\bin\java.exe".
The question is how do I configure buckminster to use my 1.8 JDK?

can you try the answer i specified:
How to trigger Jenkins builds remotely and to pass parameters
I mean even JDK can be parameterised, let me know.

Related

"Could not run phased build action using connection to Gradle distribution"

I'm having various Gradle problems after a new clean Eclipse install.
They seem to be associated w/ this "Problem" message:
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.1.1-bin.zip'.
Initialization script 'Z:\eclipse-workspace\.metadata\.plugins\org.eclipse.buildship.core\init.d\eclipsePlugin.gradle'
Could not compile initialization script 'Z:\eclipse-workspace\.metadata\.plugins\org.eclipse.buildship.core\init.d\eclipsePlugin.gradle'.
startup failed:
General error during semantic analysis: Unsupported class file major version 60
java.lang.IllegalArgumentException: Unsupported class file major version 60
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:196)
.....
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:831)
1 error
I've already tried deleting .gradle & "Gradle->Refresh Gradle Project".
I've also tried this:
stackoverflow
My Java install is clean:
java version "16.0.1" 2021-04-20
& confirmed Eclipse is pointing to it ("Preferences->Java->Installed JREs").
Installation details:
Buildship: Eclipse Plug-ins for Gradle 3.1.5.v20210113-0929
Eclipse IDE for Java Developers 4.20.0.20210612-1200
Windows 10.
Eclipse Install Err Log:
!ENTRY org.eclipse.buildship.core 2 2 2021-07-09 11:22:05.951
!MESSAGE Initialize project testgradleprj failed due to an error in the referenced Gradle build.
!STACK 0
org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.1.1-bin.zip'.
Gradle 6.8 does not work with Java 16.
Java 16 supported starting with Gradle 7
"In previous Gradle versions, running Gradle itself on Java 16 resulted in an error."
https://docs.gradle.org/7.0/release-notes.html#java-16
Thanks to LMC. I changed the project prefs->Gradle from Wrapper to Specific=7.1.1 :
I have updated my gradle-warpper.properties file with
distributionUrl=https://services.gradle.org/distributions/gradle-6.4.1-bin.zip
from
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.2-bin.zip
and refresh the gradlew project in eclipse. It's build successfull
Note : Java 11 version is installed in my machine
Change your gradle.properties file
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
And build.gradle file
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
}
In my case, it was because Eclipse was running upon a JVM that was different from the one used by my local Gradle.
I edited the eclipse.ini file so that Eclipse would run on the same JVM as my local Gradle (i.e. the one pointed by JAVA_HOME) and it worked!

How to fix the Error: "org.jetbrains.jps.incremental.scala.remote.ServerException java.lang.StackOverflowError"

I'm trying to run the main class in the scala-sbt project. Running the class is resulting in stackoverflow Error, StackTrace pasted below.
I am sure this is not a code Issue because for the same project I was able to run sbt package by setting the memory in sbt conf file as described here: https://stackoverflow.com/q/55874883.
I tried to set the params in Intellij> Settings> Scala Compile Server, but it didn't help to overcome Error.
JDK: Profile Default
Jvm maximum heap size, MB: 2024
JVM options: -server -Xmx2G -Xss20m -XX:MaxPermSize=1000m -XX:ReservedCodeCacheSize=1000m
IntelliJ:
IntelliJ IDEA 2019.1 (Community Edition)
Build #IC-191.6183.87, built on March 27, 2019
JRE: 1.8.0_202-release-1483-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Sbt Version: 1.2.8
Scala Version: 2.11.8
Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException
java.lang.StackOverflowError
at scala.tools.nsc.transform.TailCalls$TailCallElimination.transform(TailCalls.scala:273)
at scala.tools.nsc.transform.TailCalls$TailCallElimination.transform(TailCalls.scala:209)
at scala.tools.nsc.transform.TailCalls$TailCallElimination.noTailTransform(TailCalls.scala:214)
at scala.tools.nsc.transform.TailCalls$TailCallElimination.transform(TailCalls.scala:403)
at scala.tools.nsc.transform.TailCalls$TailCallElimination.transform(TailCalls.scala:209)
at scala.tools.nsc.transform.TailCalls$TailCallElimination.noTailTransform(TailCalls.scala:214)
at scala.tools.nsc.transform.TailCalls$TailCallElimination.transform(TailCalls.scala:403)
at scala.tools.nsc.transform.TailCalls$TailCallElimination.transform(TailCalls.scala:209)
redacted...
I've had the same issue with Intellij IDEA Ultimate 2020.1.1.
None of above options worked for me. But with a hint of the above answer, I found there was also different setting for the Scala compiler, after changing it the error stopped.
I increased the size of stack trace of the Scala compiler server: Preferences -> Compiler -> Scala Compiler -> Scala Compiler Server. Then, change the JVM options accordingly (In my case, -server -Xss1024m).
I've had the same issue with Intellij IDEA Community Edition 2019.3.4.
In the end, what worked for me was this solution. Basically, go to Settings -> Build, Execution, Deployment -> Compiler
Then, on "User-local build process VM options" set the stack size to a greater value with -Xss
In my case, I finally managed to run the tests setting it to -Xss2048m
I hope this helps.
Go to Configure → Edit Custom VM Options and add your changes there
If you're able to do sbt package (so you have sufficient heap size and -Xss configured for sbt) but running class still throws java.lang.StackOverflowError try going to
Settings -> Build, Execution, Deployment -> sbt
and tick
sbt shell -> use for: project reload and builds
try those options

SBT unable to find installed java on my machine despite $JAVA_HOME set correctly

I did
brew install scala
brew install sbt
scala works fine for me, however when I try to run sbt, I get:
⇒ sbt
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
No java installations was detected.
Please go to http://www.java.com/getjava/ and download
siddhartha#Siddharthas-MacBook-Pro-2:~|
⇒ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
I checked the following 2 links but neither have a helpful answer:
No Java installation was detected while sbt update
Why does sbt report "No java installations was detected" with $JAVA_HOME set?
Any help appreciated.
My solution was to do a sudo. I suppose permissions for sbt in /usr/local are set for root when installed via brew.
The sbt script that launches java (sbt-launch-lib.bash) prints “No java installations was detected” (now “No Java Development Kit (JDK) installation was detected.”) if there is any error running java -version with the current environment variables JAVA_TOOL_OPTIONS, _JAVA_OPTIONS. So if either of these variables contains impossible options, sbt will give the misleading error instead of the actual error.
JAVA_TOOL_OPTIONS or _JAVA_OPTIONS might be misconfigured to have a too large memory usage (e.g. -Xms100g). Or it might be misconfigured to listen to a debug port (e.g. -agentlib:jdwp=transport=dt_sockerver=y,suspend=n,address=5005) that is already bound by another program.
The sbt script applies JAVA_OPTS and SBT_OPTS only after checking java -version, so if you set those instead, then you may get a better error message.

maven in command line succeed, but failed when using the same maven in eclipse

I'm trying to build the project of hadoop. I followed the official document as follows on how to do that.
http://wiki.apache.org/hadoop/HowToContribute
https://wiki.apache.org/hadoop/EclipseEnvironment
I've git clone the project, maven install it successfully, but when I import the project, or even a sub-project like 'hadoop-yarn-api', I got the following errors on maven:
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (execution: compile-protoc, phase: generate-sources) pom.xml /hadoop-yarn-api line 73 Maven Project Build Lifecycle Mapping Problem
Then I'm trying to mvn clean install the project via External Tools Configuration in eclipse, it also failed on:
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-yarn-api: org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did not return a version -> [Help 1]
But the curious part is that when I cd into the root directory of 'hadoop-yarn-api' and invoke mvn clean install, it can be built successfully.
I'm using m2ecipse in eclipse, and I'm sure that I've changed to the maven which is exactly the one that I'm used in command line, not the embedded one.
And I've installed protocol buffers 2.5.0:
$ protoc --version
libprotoc 2.5.0
Could anyone give me some idea? Many thanks!
P.S.
Eclipse Java EE IDE - Juno Service Release 2
m2e - 1.4.1.20140328-1905
Mac 1- 0.9.4
maven - 3.0.5
Hadoop - 2.2.0

upgrade weblogic server from 12cr1 to 12cr2

I need to know how can i upgrade my Weblogic application server from release 1 to release 2.
My OS is windows 7 64 bit. I am new to this some one else installed weblogic so i tried to install it by myself but it is giving me error
C:\Users\User\Downloads>java -D64 -jar wls_121200.jar
Extracting files................................................................
....................................
This installer must be executed using a Java Development Kit (JDK)
but C:\Program Files\Java\jre7 is not a valid JDK.
The Oracle Universal Installer failed. Exiting.
so i unzipped the jar with 7 zip now intaller has started is it the correct way?
Using command prompt, navigate to the directory where you downloaded the installation program.
Launch the installation program by invoking java -jar from the JDK directory on your system,
as shown in the example below:
\home\Oracle\jdk7_15\jdk1.7.0_15\bin\java -jar wls_121200.jar -- sure to replace \home\Oracle\jdk7_15\jdk1.7.0_15 -- in this example with the location of the JDK on your system
The only thing you need is to execute the installer using the jdk needed for it.
for example:
"C:\Program Files\Java\jdk1.7.0_79\bin\java.exe" -jar wls_121200.jar
I used the java.exe from my jdk 7 folder instead of the java installed on my computer.
The weblogic jar folder doesn't matter.
use the following command:
C:\Softwares\Weblogic12c> "\Program Files\Java\jdk1.7.0_05\bin"\java
-jar fmw_12.2.1.0.0_wls.jar
C:\Softwares\Weblogic12c> is the location of my weblogic jar file.
"\Program Files\Java\jdk1.7.0_05\bin"\ is the location of my jdk.
It may happen that the jar is not taking the JAVA_HOME or PATH variables that may be set in the environment variables. In this case you may set it manually in the cmd. GOTO Run->cmd.
Then goto the folder where you have placed your jar
C:\Users\User\Downloads>set JAVA_HOME=C:\Program Files\...\jdk1.8.0_112
C:\Users\User\Downloads>set PATH=C:\Program Files\...\jdk1.8.0_112\bin;%PATH%
and then you may go on executing the jar,
C:\Users\User\Downloads>java -jar wls_121200.jar
It worked for me! Hope it helps. Thanks.
Run as Administrator the Command Prompt
Open the Weblogic's jar directory
Execute the java -jar command over the jar file:
From Runtime Variable (Make sure you have it set)
java -jar wls_121200.jar
From sepecific directory
"C:\Program Files\Java\jdk1.7.0_79\bin\java.exe" -jar wls_121200.jar