Unable to locate the Javac Compiler in: - linux

I have installed OpenJDK as mentored below. But i still keep getting this error. I have set the right PATH in bash_profile.
Can someone help me out of this?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler- plugin:2.3.2:compile (default-compile) on project poker-protocol: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :poker-protocol
In my bash_profile i have this:
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
export M2_HOME=/usr/local/apache-maven-3.0.4
export PATH=${M2_HOME}/bin:${PATH}:$JAVA_HOME/bin
Can someone help me out?

You have installed the Java runtime, but to develop Java applications you need the JDK, hence you must install the OpenJDK devel package,in your case java-1.6.0-openjdk-devel-1.6.0.0.x86_64.

Not so sure about that but in my case i have set it this way :
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_11/
export PATH=$JAVA_HOME/bin:$PATH
I have done this in bash.bashrc
Try adding export before providing the variable name. Another thing i discovered even thought am not using openjdk, is that the tool.jar is not locate in the jre directory but under jdk directory.
Hope this helps.

you need to install the java-1.6.0-openjdk-devel installing the java-1.6.0-openjdk just installs JRE .

Related

How I can fix 'failed to parse the `edition` key' in anchor build command?

I am trying run anchor build but
error: failed to download `anchor-attribute-access-control v0.26.0`
Caused by:
unable to get packages from source
Caused by:
failed to parse manifest at `/Users/???/.cargo/registry/src/github.com-1ecc6299db9ec823/anchor-attribute-access-control-0.26.0/Cargo.toml`
Caused by:
failed to parse the `edition` key
Caused by:
this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions.
I fix edition but I see the same error for another packages. (for example)
Caused by:
failed to parse manifest at `/Users/???/.cargo/registry/src/github.com-1ecc6299db9ec823/anchor-attribute-account-0.26.0/Cargo.toml`
I guess I can do smth I don't need fix manually each package.
Thanks
PS:
rustup -V:
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.66.1 (90743e729 2023-01-10)`
cargo -V
cargo 1.66.1 (ad779e08b 2023-01-10)
anchor -V
anchor-cli 0.26.0
os: macOS Big Sur 11.6.5

Cargo error: unable to get packages from source

error: failed to download `adler v1.0.2`
Caused by:
unable to get packages from source
Caused by:
failed to parse manifest at `/home/actionanand/.cargo/registry/src/github.com-1ecc6299db9ec823/adler-1.0.2/Cargo.toml`
Caused by:
could not parse input as TOML
Caused by:
unexpected character found: `\u{0}` at line 1 column 1
Rust .toml file was full of red line when we add new dependency
This is caused by the crash of internal package (say cargo)
we can solve this by following the steps
Please clear the cargo registry
rm -rf /home/username/.cargo/registry/
And follow the proceedure shown after this, if you use old version
For the reference, I've given the proceedure also below:
If you are trying to migrate from the previous edition (2018), the
process requires following these steps:
1. Start with `edition = "2018"` in `Cargo.toml`
2. Run `cargo fix --edition`
3. Modify `Cargo.toml` to set `edition = "2021"`
4. Run `cargo build` or `cargo test` to verify the fixes worked
More details may be found at
https://doc.rust-lang.org/edition-guide/editions/transitioning-an-existing-project-to-a-new-edition.html
You may need to to add --allow-no-vcs sometimes (it'll be prompted by the terminal) as below
cargo fix --edition --allow-no-vcs

Building Nuxeo source code, dart issue

I am trying to build nuxeo source code & noticing below build issue. I noticed similar reported issue here. Has anyone faced similar issue?
Build error:
[exec] Transform Dart2JS on nuxeo_api_playground|web/index.web_components.bootstrap.dart threw error: type 'PrefixElementX' is not a subtype of type 'MemberEntity' in type cast where
An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] /Users/kalava/Documents/Work/DAM/NuxeoOpenSource/nuxeo/addons/nuxeo-api-playground/src/main/dart/build.xml:9: exec returned: 65
[ERROR] around Ant part ...... # 4:278 in /Users/kalava/Documents/Work/DAM/NuxeoOpenSource/nuxeo/addons/nuxeo-api-playground/target/antrun/build-main.xml
Do you have the proper Dart version, as documented at https://doc.nuxeo.com/corg/installing-dart-and-related-tools/? Currently Nuxeo build requires Dart 1.23.x.

Failed to build an ARM cross compiler with crosstool-ng

I'm doing a lab from Free Electron to building a cross-compilation toolchain
But when I run the build command it fails shortly after downloading things...
My stuff : xubuntu 14.04.3 | crosstool-ng-1.19.0
When I run ./ct-ng build
[DEBUG] Entering '/home/thibaut/felabs/sysdev/toolchain/crosstool-ng-1.19.0/.build/src/mpfr-2.4.2'
[DEBUG] Running autoreconf
[DEBUG] ==> Executing: 'autoreconf'
[ALL ] aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
[ERROR] configure.in:294: error: automatic de-ANSI-fication support has been removed
[ALL ] /usr/share/aclocal-1.14/obsolete.m4:26: AM_C_PROTOTYPES is expanded from...
[ALL ] configure.in:294: the top level
[ALL ] autom4te: /usr/bin/m4 failed with exit status: 1
[ERROR] aclocal: error: echo failed with exit status: 1
[ALL ] autoreconf: aclocal failed with exit status: 1
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Extracting and patching toolchain components'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions#257]
[ERROR] >> called from: do_mpfr_extract[scripts/build/companion_libs/110-mpfr.sh#37]
[ERROR] >> called from: do_companion_libs_extract[scripts/build/companion_libs.sh#22]
[ERROR] >> called from: main[scripts/crosstool-NG.sh#600]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: 'build.log'
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >> 'docs/B - Known issues.txt'
[ERROR]
[ERROR] (elapsed: 0:03.97)
It looks like an incompatibility between version of mpfr used by crosstool-ng and your version of autoconf. I suggest to try a newer version of crosstool-ng (version 1.19 was released in 2013).
If you really need crosstool-ng 1.19, you can try to compile autoconf version from "Companion tools" (EXPERIMENTAL has to be set).
You can also try to install an another version of autoconf. I believe that Ubuntu 14.04 provides autoconf 2.13, 2.59 and 2.68. You can try them.
SOLUTION :
The problem was my version of mpfr... So to fixe that I config with ./-ct-ng menuconfig , and I tell him to rebuild this module. It's was in the section Companion libraries.

Is there any specific sbt version required to compile the cassandra-spark-connector

I am assembling the "Cassandra-Spark-Connector". I just followed the steps below:
Git clone connector code
Run "sbt assembly"
During the assembly phase I am getting the following error:
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn] * com.eed3si9n:sbt-assembly:0.11.2 -> 0.13.0
[warn] Run 'evicted' to see detailed eviction warnings
[info] Compiling 5 Scala sources to /home/xxxxxx/Development/iAdLearning/spark-cassandra-connector/project/target/scala-2.10/sbt-0.13/classes...
[error] /home/xxxxxx/Development/iAdLearning/spark-cassandra-connector/project/Settings.scala:23: object Plugin is not a member of package sbtassembly
[error] import sbtassembly.Plugin._
[error] ^
[error] /home/xxxxxx/Development/iAdLearning/spark-cassandra-connector/project/Settings.scala:24: not found: object AssemblyKeys
[error] import AssemblyKeys._
[error] ^
[error] /home/xxxxxx/Development/iAdLearning/spark-cassandra-connector/project/Settings.scala:217: not found: value assemblySettings
[error] lazy val sbtAssemblySettings = assemblySettings ++ Seq(
[error] ^
[error] three errors found
[error] (compile:compileIncremental) Compilation failed
I am running sbt 0.13.6
You can always use the packaged sbt by running.
./sbt/sbt assembly
This will automatically download and use a valid version of sbt.
Building Spark java connector requires sbt-assembly version 0.11.2 as defined in plugins.bat. It is likely you have a newer sbt-assembly version (ver. 0.13.0) installed in global plugins folder (~.sbt\0.13\plugins) which is causing this issue.
Kindly rename the plugins folder in ~.sbt\0.13 and try to build it again.

Resources