Octave 3.8.2, OS X 10.10.4
I used
ml_jar_version=javaMethod('getProperty','java.lang.System','java.version');
ml_jar_version=['Java ' ml_jar_version];
to check the java version and I got
ml_jar_version = Java 1.6.0_65
However, I want Octave to use JDK 1.7 and so I typed
setenv("JAVA_HOME","/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home");
but ml_jar_version did not change.
My question is: how to make Octave to use JDK 1.7?
Edit 1: my Octave was installed through homebrew. I believe homebrew just downloaded precompiled binaries. The following is the configuration of my Octave installation:
homebrew/science/octave: stable 3.8.2 (bottled), HEAD
a high-level interpreted language for numerical computations.
https://www.gnu.org/software/octave/index.html
/usr/local/Cellar/octave/3.8.2_1 (2111 files, 54M)
Poured from bottle
/usr/local/Cellar/octave/3.8.2_2 (2111 files, 54M) *
Poured from bottle
From: https://github.com/homebrew/homebrew-science/blob/master/octave.rb
==> Dependencies
Build: pkg-config ✔, gnu-sed ✘
Required: pcre ✔, qscintilla2 ✔, qt ✔, pstoedit ✔
Recommended: gnuplot ✔, suite-sparse421 ✔, readline ✔, arpack ✔, fftw ✔, glpk ✔, gl2ps ✔, graphicsmagick ✔, hdf5 ✔, qhull ✔, qrupdate ✔, epstool ✔, ghostscript ✔
Optional: openblas ✘
==> Options
--with-jit
Use the experimental JIT support (not recommended)
--with-native-graphics
Use native OpenGL/FLTKgraphics (does not work with the GUI)
--with-openblas
Use OpenBLAS instead of native LAPACK/BLAS
--without-arpack
Build without arpack support
--without-check
Skip build-time tests (not recommended)
--without-curl
Do not use cURL (urlread/urlwrite/#ftp)
--without-docs
Don't build documentation
--without-epstool
Build without epstool support
--without-fftw
Do not use FFTW (fft,ifft,fft2,etc.)
--without-ghostscript
Build without ghostscript support
--without-gl2ps
Build without gl2ps support
--without-glpk
Do not use GLPK
--without-gnuplot
Do not use gnuplot graphics
--without-graphicsmagick
Build without graphicsmagick support
--without-gui
Do not build the experimental GUI
--without-hdf5
Do not use HDF5 (hdf5 data file support)
--without-java
Build without java support
--without-qhull
Do not use the Qhull library (delaunay,voronoi,etc.)
--without-qrupdate
Do not use the QRupdate package (qrdelete,qrinsert,qrshift,qrupdate)
--without-readline
Build without readline support
--without-suite-sparse421
Do not use SuiteSparse (sparse matrix operations)
--without-zlib
Do not use zlib (compressed MATLAB file formats)
--HEAD
Install HEAD version
It seems that octave reads the symbolic link 'dafault-java', here:
/usr/lib/jvm/default-java
$ls -al
drwxr-xr-x 5 root root 4096 нов 19 21:37 .
drwxr-xr-x 181 root root 12288 нов 19 20:45 ..
lrwxrwxrwx 1 root root 14 нов 19 21:37 default-java -> java-8-openjdk-amd64/
lrwxrwxrwx 1 root root 20 апр 23 2016 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64
-rw-r--r-- 1 root root 2600 окт 27 21:06 .java-1.8.0-openjdk-amd64.jinfo
drwxr-xr-x 8 root root 4096 нов 19 20:45 java-7-oracle
-rw-r--r-- 1 root root 2543 нов 19 20:45 .java-7-oracle.jinfo
drwxr-xr-x 7 root root 4096 нов 19 21:37 java-8-openjdk-amd64
drwxr-xr-x 2 root root 4096 нов 16 20:28 openjdk-8
You need to change it to point to your java folder :
First remove it:
$sudo rm default-java
Then make a new symbolic link (java-7-oracle in my case):
$ln -s java-7-oracle/ default-java
It shoud work afterwards.
In octave:
>> javaMethod('getProperty','java.lang.System','java.version')
ans = 1.7.0_80
Related
I've read a similar issue but my environment is different.
I've cloned the Corda samples and ensured that I have Java 8 (update 301) and Gradle 5.6.4:
cordapp-example % java -version
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)
cordapp-example % gradle -version
------------------------------------------------------------
Gradle 5.6.4
------------------------------------------------------------
Build time: 2019-11-01 20:42:00 UTC
Revision: dd870424f9bd8e195d614dc14bb140f43c22da98
Kotlin: 1.3.41
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM: 1.8.0_301 (Oracle Corporation 25.301-b09)
OS: Mac OS X 10.16 x86_64
Yet when I follow the "Run a sample Cordapp" tutorial I fail at the runnodes step:
cordapp-example % bash -c 'cd "/Users/arinea/Munca/Corda/samples-java/Basic/cordapp-example/build/nodes/PartyB" ; "/Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home/bin/java" "-Dcapsule.jvm.args=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5007 -javaagent:drivers/jolokia-jvm-1.6.0-agent.jar=port=7007,logHandlerClass=net.corda.node.JolokiaSlf4jAdapter" "-Dname=PartyB" "-jar" "/Users/arinea/Munca/Corda/samples-java/Basic/cordapp-example/build/nodes/PartyB/corda.jar" && exit'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by Capsule (file:/Users/arinea/Munca/Corda/samples-java/Basic/cordapp-example/build/nodes/PartyB/corda.jar) to field com.sun.jmx.mbeanserver.JmxMBeanServer.mbsInterceptor
WARNING: Please consider reporting this to the maintainers of Capsule
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Listening for transport dt_socket at address: 5007
[quasar] ERROR: java/lang/Object
java.lang.IllegalArgumentException
at co.paralleluniverse.asm.ClassReader.<init>(Unknown Source)
at co.paralleluniverse.asm.ClassReader.<init>(Unknown Source)
at co.paralleluniverse.asm.ClassReader.<init>(Unknown Source)
at co.paralleluniverse.fibers.instrument.MethodDatabase.checkFileAndClose(MethodDatabase.java:345)
at co.paralleluniverse.fibers.instrument.MethodDatabase.checkClass(MethodDatabase.java:325)
at co.paralleluniverse.fibers.instrument.MethodDatabase.getOrLoadClassEntry(MethodDatabase.java:184)
at co.paralleluniverse.fibers.instrument.SimpleSuspendableClassifier.isSuspendable(SimpleSuspendableClassifier.java:156)
at co.paralleluniverse.fibers.instrument.DefaultSuspendableClassifier.isSuspendable(DefaultSuspendableClassifier.java:47)
at co.paralleluniverse.fibers.instrument.CheckInstrumentationVisitor.visitMethod(CheckInstrumentationVisitor.java:130)
at co.paralleluniverse.asm.ClassReader.b(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.fibers.instrument.MethodDatabase.checkFileAndClose(MethodDatabase.java:348)
at co.paralleluniverse.fibers.instrument.MethodDatabase.checkClass(MethodDatabase.java:325)
at co.paralleluniverse.fibers.instrument.MethodDatabase.getOrLoadClassEntry(MethodDatabase.java:184)
at co.paralleluniverse.fibers.instrument.MethodDatabase.isMethodSuspendable0(MethodDatabase.java:195)
at co.paralleluniverse.fibers.instrument.MethodDatabase.isMethodSuspendable(MethodDatabase.java:162)
at co.paralleluniverse.fibers.instrument.InstrumentMethod.isSuspendableCall(InstrumentMethod.java:231)
at co.paralleluniverse.fibers.instrument.LabelSuspendableCallSitesClassVisitor$1.visitMethodInsn(LabelSuspendableCallSitesClassVisitor.java:64)
at co.paralleluniverse.asm.ClassReader.a(Unknown Source)
at co.paralleluniverse.asm.ClassReader.b(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.asm.ClassReader.accept(Unknown Source)
at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:129)
at co.paralleluniverse.fibers.instrument.QuasarInstrumentor.instrumentClass(QuasarInstrumentor.java:100)
at co.paralleluniverse.fibers.instrument.JavaAgent$Transformer.transform(JavaAgent.java:241)
at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:760)
at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:655)
Upon careful inspection of the first lines in the three tabs that fail we see:
... "/Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home/bin/java" ...
I do also have this Java 11 installed on my OS X but why is it being picked up!?
java -version, as seen above, points to 1.8 u301,
cordapp-example % echo $JAVA_HOME
/Users/arinea/.jenv/versions/1.8.0.301
cordapp-example % ll /Users/arinea/.jenv/versions
total 0
lrwxr-xr-x 1 arinea staff 64B 24 Iul 22:37 1.8 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 64B 24 Iul 22:37 1.8.0.241 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 64B 13 Aug 16:00 1.8.0.301 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 63B 24 Iul 22:37 11 -> /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 63B 24 Iul 22:37 11.0 -> /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 63B 24 Iul 22:37 11.0.10 -> /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 64B 24 Iul 22:37 oracle64-1.8.0.241 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 64B 13 Aug 16:00 oracle64-1.8.0.301 -> /Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home
lrwxr-xr-x 1 arinea staff 63B 24 Iul 22:37 oracle64-11.0.10 -> /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
For the life of me I can't tell why is JDK11 picked up.. Do I need to remove it from my system?
Later edit:
This problem happens when I run ./build/nodes/runnodes from the cordapp-example directory. If I go to build/nodes and run there java -jar runnodes.jar everything works well, as expected...
The answer is right in the runnodes script file:
1 #!/usr/bin/env bash
2
3 set -eo pipefail
4
5 # Allow the script to be run from outside the nodes directory.
6 basedir=$( dirname "$0" )
7 cd "$basedir"
8
9 if [ -z "$JAVA_HOME" ] && which osascript >/dev/null; then
10 # use default version of java installed on mac
11 /usr/libexec/java_home --exec java -jar runnodes.jar "$#"
12 else
13 "${JAVA_HOME:+$JAVA_HOME/bin/}java" -jar runnodes.jar "$#"
14 fi
Line 11 gets executed (as opposed to line 13) which uses /usr/libexec/java_home which in my case (and many other people's, judging from what I could find on the net..) will point to the latest JDK installed. That is JDK 11 and Corda is not compatible with it.
Just make sure you don't use that one and use a JDK 8 above update 131.
I have 2 java on my server, where I installed java8 first, then java 11
by default, there is no jre -> /etc/alternatives/jre
[root#server-1:jvm]# ls -all
...
lrwxrwxrwx 1 root root 26 Mar 17 09:10 java -> /etc/alternatives/java_sdk
drwxr-xr-x 9 root root 215 Mar 17 09:10 java-11-amazon-corretto
drwxr-xr-x 3 root root 17 Mar 17 07:17 java-1.8.0-amazon-corretto.x86_64
While after I set the default java with alternative command, the link to /etc/alternatives/jre is created automatically
[root#server-1:jvm]# alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
+ 1 /usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre/bin/java
* 2 /usr/lib/jvm/java-11-amazon-corretto/bin/java
Enter to keep the current selection[+], or type selection number: 2
[root#server-1:jvm]# ls -all
...
lrwxrwxrwx 1 root root 26 Mar 17 09:10 java -> /etc/alternatives/java_sdk
drwxr-xr-x 9 root root 215 Mar 17 09:10 java-11-amazon-corretto
drwxr-xr-x 3 root root 17 Mar 17 07:17 java-1.8.0-amazon-corretto.x86_64
lrwxrwxrwx 1 root root 21 Mar 17 09:21 jre -> /etc/alternatives/jre <<<<< i want to keep this
But once I switch back to java8, the jre -> /etc/alternatives/jre was removed.
How can I keep the link?
UPDATE: example problem what to be solved
A application have to access the cacert file in java, e.g.
***/usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre***/lib/security/cacerts
***/usr/lib/jvm/java-11-amazon-corretto.x86_64***/lib/security/cacerts
So I would like to have the /usr/lib/jvm/jre or /etc/alternatives/jre pointing to the java home
In case of corretto8
/usr/lib/jvm/jre -> /etc/alternatives/jre -> /usr/lib/jvm/java-1.8.0-amazon-corretto.x86_64/jre
In case of corretto11 (which the 'alternative' already did if I switch to )
/usr/lib/jvm/jre -> /etc/alternatives/jre -> /usr/lib/jvm/java-11-amazon-corretto.x86_64
Help please. In our workflow we only work with pre-packaged offline deploys where we do not have root access and therefore use supervisord to stop start ALL packages. We deploy all our packages under a user account. I have created a custom Jenkins package. Its basically its a folder containing the Jenkins war file and configurations from when I tool a vanilla initial setup.
My installation has worked up until now. Seems trying to get things running for the first time seems flaky. Once running Jenkins is fine. This time I am trying to deploy the packages (they have not changed) however I cannot start Jenkins and get and error:
jenkins.model.InvalidBuildsDir: does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR}, cannot distinguish between projects
So what I did was get a clean fresh install running and packaged it up. Basically I untar the jenkins directory then use supervisord to control start/stop.
Supervisord config:
[program:jenkins]
autorestart = true
autostart = true
command = /bin/bash -c "set JENKINS_HOME=/opt/home/svc_user/opskit/jenkins; /opt/home/svc_user/opskit/jdk/bin/java -Djava.awt.headless=true -Djenkins.model.Jenkins.buildsDir=/opt/home/svc_user/data/jenkins/builds/${ITEM_FULL_NAME} -Djenkins.model.Jenkins.workspacesDir=/opt/home/svc_user/data/jenkins/workspace/${ITEM_FULL_NAME} -jar /opt/home/svc_user/opskit/jenkins/bin/jenkins.war -path=/opt/home/svc_user/opskit/jenkins"
directory = /opt/home/svc_user/opskit/jenkins
redirect_stderr = true
stdout_logfile = /opt/home/svc_user/opskit/log/jenkins.log
stdout_logfile_backups = 5
stdout_logfile_maxbytes = 10MB
stopwaitsecs = 300
Full error:
jenkins.model.InvalidBuildsDir: /opt/home/svc_user/data/jenkins/builds does not contain ${ITEM_FULL_NAME} or ${ITEM_ROOTDIR}, cannot distinguish between projects
at jenkins.model.Jenkins.checkRawBuildsDir(Jenkins.java:3179)
at jenkins.model.Jenkins.setBuildsAndWorkspacesDir(Jenkins.java:3135)
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3123)
Caused: java.io.IOException
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3125)
at jenkins.model.Jenkins.access$1200(Jenkins.java:320)
at jenkins.model.Jenkins$13.run(Jenkins.java:3219)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1133)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused: org.jvnet.hudson.reactor.ReactorException
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:50)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:1166)
at jenkins.model.Jenkins.<init>(Jenkins.java:966)
at hudson.model.Hudson.<init>(Hudson.java:85)
at hudson.model.Hudson.<init>(Hudson.java:81)
at hudson.WebAppMain$3.run(WebAppMain.java:233)
Caused: hudson.util.HudsonFailedToLoad
at hudson.WebAppMain$3.run(WebAppMain.java:250)
Jenkins config.xml:
<workspaceDir>/opt/home/svc_user/data/jenkins/workspace/${ITEM_FULL_NAME}</workspaceDir>
<buildsDir>/opt/home/svc_user/data/jenkins/builds/${ITEM_FULL_NAME}</buildsDir>
Folder permissions (install dir):
lrwxrwxrwx 1 svc_user svc_user 39 Jun 4 02:51 jenkins -> /opt/home/svc_user/opskit/jenkins-2.222.3
drwxr-xr-x 13 svc_user svc_user 4096 May 1 05:07 jenkins-2.222.3
Folder permissions (custom dir for builds and workspaces):
lrwxrwxrwx 1 svc_user svc_user 37 Jun 4 02:51 jenkins -> /opt/home/svc_user/data/jenkins-2.222.3
drwxr-xr-x 4 svc_user svc_user 37 Jun 4 16:39 jenkins-2.222.3
|-nginx-1.16.1
|-jdk-8u91
|-jenkins-2.222.3
| |-builds
| |-workspace
Help would be greatly appreciated. Thank you in advance.
Modified this:
command = /bin/bash -c "JENKINS_HOME=/opt/home/svc_user/opskit/jenkins /opt/home/svc_user/opskit/jdk/bin/java...
^^
Nothing to do with the fix, just launches 1 java process instead of 2.
Deleted:
-Djenkins.model.Jenkins.buildsDir=/opt/home/svc_user/data/jenkins/builds/${ITEM_FULL_NAME}
-Djenkins.model.Jenkins.workspacesDir=/opt/home/svc_user/data/jenkins/workspace/${ITEM_FULL_NAME}
^^
Fixed my startup issue. Not sure why these had no negative effects on previous installations.
Also deleted:
path=/opt/home/svc_user/opskit/jenkins
Seemed isnt necessary.
¯_(ツ)_/¯
I have a Maven project in IntelliJ working with the bundled version of Maven however when I come to do a release:prepare release:perform directly from within the IDE I get the following error.
Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project XXXXXX: Maven execution failed, exit code: '126'
Within IntelliJ I am using a project specific JDK (JDK 8) which is different to my machine JDK (JDK 11). I also am using the bundled Maven 3 with IntelliJ 2020.1 but have no Maven installed on my machine outside of the IDE.
I don't use JDK 8 or Maven anywhere other than this one project so would like to not have to install the extra tools globally if I can get away with running then from within this one project in the IDE. Is that possible? I'm building a Jenkins plugin for context if that matters?
Question: What is exit code 126?
Question: In order to perform a release:prepare release:perform do I need to to install the bundled project specific tools on my machine as opposed to keeping them within my project in IntelliJ?
Edit: Running with -x or --debug yields this error:
[INFO] Executing: /bin/sh -c cd /home/XXX/Development/XXXXX-plugin && /home/XXXX/.local/share/JetBrains/Toolbox/apps/IDEA-C/ch-0/201.7223.91/plugins/maven/lib/maven3/bin/mvn -s /tmp/release-settings2724175258197430802.xml clean install --no-plugin-updates -P jenkins
/bin/sh: 1: /home/XXXX/.local/share/JetBrains/Toolbox/apps/IDEA-C/ch-0/201.7223.91/plugins/maven/lib/maven3/bin/mvn: Permission denied
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
It appears to be this bug: https://youtrack.jetbrains.com/issue/IDEA-139236
Which is duplicated by: https://youtrack.jetbrains.com/issue/IDEA-157229 that contains the following workaround:
Using a newly generated plugin project using the
maven-archytype-plugin, when I tried running the default integration
test, it failed due to the following error:
/bin/sh: /Applications/IntelliJ IDEA 14.app/Contents/plugins/maven/lib/maven3/bin/mvn: Permission denied
When checking the /Applications/IntelliJ IDEA
14.app/Contents/plugins/maven/lib/maven3/bin/:
evil-jim-klo:lib2 jklo$ cd "/Applications/IntelliJ IDEA 14.app/Contents/plugins/maven/lib/maven3/bin/"
evil-jim-klo:bin jklo$ ls -l
total 88
-rw-r--r--# 1 jklo admin 183 Dec 21 04:08 m2.conf
-rw-r--r--# 1 jklo admin 5063 Dec 21 04:08 mvn
-rw-r--r--# 1 jklo admin 5985 Dec 21 04:08 mvn.bat
-rw-r--r--# 1 jklo admin 5253 Dec 21 04:08 mvnDebug
-rw-r--r--# 1 jklo admin 6167 Dec 21 04:08 mvnDebug.bat
-rw-r--r--# 1 jklo admin 5539 Dec 21 04:08 mvnyjp
Note none of the files are set to executable. The expectation is that
all maven binaries should be executable by default upon installation
or application update.
I corrected the problem by performing:
chmod a+x *
chmod a-x m2.conf
to produce the following permissions:
evil-jim-klo:bin jklo$ ls -l
total 88
-rw-r--r--# 1 jklo admin 183 Dec 21 04:08 m2.conf
-rwxr-xr-x# 1 jklo admin 5063 Dec 21 04:08 mvn
-rwxr-xr-x# 1 jklo admin 5985 Dec 21 04:08 mvn.bat
-rwxr-xr-x# 1 jklo admin 5253 Dec 21 04:08 mvnDebug
-rwxr-xr-x# 1 jklo admin 6167 Dec 21 04:08 mvnDebug.bat
-rwxr-xr-x# 1 jklo admin 5539 Dec 21 04:08 mvnyjp
You should use a local install of maven on your machine. You need to tell IntelliJ to use that version of maven in Preferences > Build, Execution, Deployment > Build Tools > Maven > "Maven home directory"
I'm running Linux Mint 18.3 cinnamon 64 bits
I just downloaded Apache NetBeans IDE 9.0
It wasn't necessary to run any script to install it, i just had to run the following command to launch it: sudo /opt/netbeans/bin/netbeans
Then enter my password and netbeans opens.
Then i made a launcher for the program because i didn't want to type the command and my password every time i open netbeans.
But the launcher didn't worked.
I realize that i didn't put "sudo" in the command that the launcher would execute so i put it. And didn't work.
I thought that it wasn't working because the launcher executes sudo /opt/netbeans/bin/netbeans but don't put the password.
After some research i end up adding star_man ALL=(ALL) NOPASSWD: /opt/netbeans/bin/netbeans at the end of /etc/sudoers and it finally works. But when i create a new project Netbeans sets root as the author of every file it creates.
For example, when i type ls -l in my project directory it outputs this:
-rw-r--r-- 1 root root 3527 sep 15 20:01 build.xml
-rw-r--r-- 1 root root 82 sep 15 20:01 manifest.mf
drwxr-xr-x 3 root root 4096 sep 15 20:01 nbproject
drwxr-xr-x 3 root root 4096 sep 15 20:01 src
Root is the group and the owner of every file an directory.
This causes that when Netbeans generates documentation files it put "root" instead my username.
Update:
I only can start neatbeans as root (sudo ./netbeans).
when i run neatbean without sudo from the terminal it looks like it's starting:screen shot
but then it closes.
This is the output:
>Log Session: Sunday, September 16, 2018 at 12:58:20 PM Eastern Daylight Time
>System Info:
Product Version = Apache NetBeans IDE 9.0 (Build incubator-netbeans-release-334-on-20180708)
Operating System = Linux version 4.15.0-34-generic running on amd64
Java; VM; Vendor = 10.0.1; Java HotSpot(TM) 64-Bit Server VM 10.0.1+10; Oracle Corporation
Runtime = Java(TM) SE Runtime Environment 10.0.1+10
Java Home = /opt/java/jdk-10.0.1
System Locale; Encoding = es_DO (nb); UTF-8
Home Directory = /home/star_man
Current Directory = /opt/netbeans
User Directory = /home/star_man/.netbeans/9.0
Cache Directory = /home/star_man/.cache/netbeans/9.0
Installation = /opt/netbeans/nb
/opt/netbeans/ide
/opt/netbeans/extide
/opt/netbeans/java
/opt/netbeans/apisupport
/opt/netbeans/websvccommon
/opt/netbeans/profiler
/opt/netbeans/harness
/opt/netbeans/javafx
/opt/netbeans/platform
Boot & Ext. Classpath =
Application Classpath = /opt/netbeans/platform/lib/boot.jar:/opt/netbeans/platform/lib/org-openide-modules.jar:/opt/netbeans/platform/lib/org-openide-util.jar:/opt/netbeans/platform/lib/org-openide-util-lookup.jar:/opt/netbeans/platform/lib/org-openide-util-ui.jar
Startup Classpath = /opt/netbeans/platform/core/core-base.jar:/opt/netbeans/platform/core/org-netbeans-libs-asm.jar:/opt/netbeans/platform/core/asm-all-5.0.1.jar:/opt/netbeans/platform/core/org-openide-filesystems.jar:/opt/netbeans/platform/core/org-openide-filesystems-compat8.jar:/opt/netbeans/platform/core/core.jar:/opt/netbeans/nb/core/org-netbeans-upgrader.jar:/opt/netbeans/nb/core/locale/core_nb.jar
-------------------------------------------------------------------------------
INFO [org.netbeans.modules.netbinox]: Install area set to file:/opt/netbeans/
!SESSION 2018-09-16 12:58:21.698 -----------------------------------------------
eclipse.buildId=unknown
java.version=10.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=es_DO
!ENTRY org.eclipse.osgi 4 0 2018-09-16 12:58:21.706
!MESSAGE Error reading configuration: Permission denied
!STACK 0
java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createTempFile(File.java:2090)
at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:67)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:61)
at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:145)
at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:115)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1331)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
at org.netbeans.core.startup.Main.start(Main.java:282)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
at java.base/java.lang.Thread.run(Thread.java:844)
java.lang.RuntimeException: Permission denied
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:194)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:67)
at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
at org.netbeans.modules.netbinox.Netbinox.init(Netbinox.java:61)
at org.netbeans.core.netigso.Netigso.prepare(Netigso.java:145)
at org.netbeans.NetigsoHandle.turnOn(NetigsoHandle.java:115)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1331)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
at org.netbeans.core.startup.Main.start(Main.java:282)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.io.IOException: Permission denied
at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createTempFile(File.java:2090)
at org.eclipse.osgi.storagemanager.StorageManager.initializeInstanceFile(StorageManager.java:188)
at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:708)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
... 16 more
I find out that every file and directory under ~/.netbeans has root as owner and group. I thought that might be the problem so i changed the owner and group with ~/.netbeans $ sudo chown -R myusername: .netbeans/. And still i'm only able to run netbeans as root.
This is a basic unix permissions problem.
For reasons that escape me, you used sudo to launch the netbeans IDE.
- You should not have done that.
- You should not have needed to do that!
When you use sudo to run something, you are typically running as the root user. (That is what sudo does!)
So, naturally, the something (in this case, the netbeans application run using sudo) will create files and directories owned by the "root" user. So when you try to update them as a normal user, the operating system says "Nope: you don't own those files / directories, so you can't modify them.".
Solution: use the chown command to change the ownership of the files and the directories as required.
How? Read man chown, or look for a tutorial on how to change the ownership of a file.
Hint: you will need to use sudo when chowning ...
Hint 2: be very, very careful when you use sudo, because sudo has the power to trash your system if you make a mistake.