Javac not installed with openjdk-6-jdk - javac

I have been trying some different java compilers over the weekend and decided to stick with javac this morning. I then proceeded to clean up the mess that was caused by my testing and removed every last trace of java and did a fresh 'apt-get install openjdk-6-jdk' after autoremove and autoclean.
The following weirdness was then encountered:
tarskin#5-PARA-11-0120:~$ javac
The program 'javac' can be found in the following packages:
* openjdk-6-jdk
* ecj
* gcj-4.4-jdk
* gcj-4.6-jdk
* gcj-4.5-jdk
* openjdk-7-jdk
Try: sudo apt-get install <selected package>
I had allready installed openjdk but i tried it anyhow yielding:
tarskin#5-PARA-11-0120:~$ sudo apt-get install openjdk-6-jdk
[sudo] password for tarskin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjdk-6-jdk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
tarskin#5-PARA-11-0120:~$
I know i must be doing something stupid but I have no idea what, if anyone else could give a pointer in the right direction that would be very much appreciated...
Cheers
EDIT: Found some other weird aspects about the 'new' instance of my java distro, it doesn't seem to recognise for example 'Pattern' or 'Matcher' that should be coming from the regex import shrugs.

TL;DR: install java-1.6.0-openjdk-devel
I had a similar issue on Fedora, but used rpm -q -l to list the contents of the (pre-installed) java-1.6.0-openjdk package, and discovered that it doesn't include javac. It is in fact only a JRE, not a JDK, as implied by the installation instructions on http://openjdk.java.net/install/ . To get javac, I installed java-1.6.0-openjdk-devel . Not exactly what I expected, because the usual packaging conventions would indicate that is the package for doing openjdk development (i.e., working on the JVM), not for developing programs with it.
Basically, openjdk's package naming doesn't follow either standard Java conventions (would require calling it a JRE somewhere), or standard Linux packaging conventions (using -devel indicates it is used for developing the package w/o -devel itself).

As per http://openjdk.java.net/install/, to install the OpenJDK-6 JRE only:
$ sudo apt-get install openjdk-6-jre
To install the full JDK:
$ sudo apt-get install openjdk-6-jdk

Check /etc/alternatives and /usr/bin. One or both will contain links to old Java versions which you had installed. When those links are broken, you can get the error message above.
To update the links after installing a new version of Java, try update-alternatives

First to check if javac is installed try to look for that file:
1. locate javac
2. or find / -name javac
And also you can check at this website with instrucions on how to install java on Ubuntu (i suppose you are on ubuntu):
http://openjdk.java.net/install/
You can also check:
http://packages.ubuntu.com/hardy/i386/openjdk-6-jdk/filelist for the files installed by the pacakge, and you can notice that javac should be installed.
Maybe you also need to run:
Open the terminal and run this command to install OpenJDK 7.0 on Ubuntu Oneiric:
sudo update-alternatives --config java

Related

Error: yq#3 has been disabled because it is not maintained upstream! How to install a disabled brew Formulae?

I'm trying to install yq#3 on my Mac running brew install yq#3 and I get the error:
Error: yq#3 has been disabled because it is not maintained upstream!
I see that it's there on their website at https://formulae.brew.sh/formula/yq#3#default but it doesn't seem to be supported anymore.
I still need to install it since our projects at work are using this specific version.
The only way that I'm thinking about is downloading the source code, building it myself, and adding it to the path but I'm thinking that there might be a simpler solution.
Any suggestion?
Thanks!
From yq github, you can install a binary by running:
wget https://github.com/mikefarah/yq/releases/download/3.4.1/yq_darwin_amd64 -O /usr/local/bin/yq &&\
chmod +x /usr/local/bin/yq
3.4.1 is the latest 3 version, darwin_amd64 is the Mac package (don't worry about having an Intel machine and installing the package that says AMD, the name comes from something about AMD invented the 64-bit instruction set).

Erlang installation giving erlang-mode is broken error

I am trying to install Elixir from the elixir website on Ubuntu 14.04. I get the following error when I execute $ sudo apt-get install esl-erlang. Can anyone help me out here ?
$ sudo apt-get install esl-erlang
Reading package lists... Done
Building dependency tree
Reading state information... Done
esl-erlang is already the newest version.
The following packages were automatically installed and are no longer required:
libgconf2-4 python-requests-whl python-setuptools-whl python-six-whl
python-urllib3-whl python-wheel
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 406 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up erlang-mode (1:21.0.5-1) ...
ERROR: erlang-mode is broken - called emacs-package-install as a new-style add-on, but has no compat file.
Install emacsen-common for emacs23
emacsen-common: Handling install of emacsen flavor emacs23
Wrote /etc/emacs23/site-start.d/00debian-vars.elc
Wrote /usr/share/emacs23/site-lisp/debian-startup.elc
Install emacsen-common for emacs24
emacsen-common: Handling install of emacsen flavor emacs24
Wrote /etc/emacs24/site-start.d/00debian-vars.elc
Wrote /usr/share/emacs24/site-lisp/debian-startup.elc
Install erlang-mode for emacs
Install erlang-mode for emacs23
install/erlang: Handling install for emacsen flavor emacs23
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-edoc.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-eunit.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-flymake.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-skels-old.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-skels.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang-start.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang.elc
Wrote /usr/share/emacs23/site-lisp/erlang/erlang_appwiz.elc
In toplevel form:
erldoc.el:64:1:Error: Cannot open load file: cl-lib
Wrote /usr/share/emacs23/site-lisp/erlang/path.elc
ERROR: install script from erlang-mode package failed
dpkg: error processing package erlang-mode (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
erlang-mode
E: Sub-process /usr/bin/dpkg returned an error code (1)
Thanks
I don't know what is causing your errors, but you could try ASDF with the Elixir plugin. This allows you to install multiple versions of Elixir and its dependencies, and uses your user environment with shims instead of installing to system directories. This avoids many of the dependency and permission problems that comes with performing a single system-level installation.
It looks like you have both emacs23 and emacs24 installed. The failure is happening when trying to build for emacs23. Unless you really want emacs23 for some reason, remove it and then it should install fine:
sudo apt-get remove emacs23
It is possible you might have to delete some of the other emacs23-* packages by hand.
This problem only affects the erlang-mode package, which adds support for editing Erlang code in Emacs. If you're not using Emacs (or not developing Erlang in it), you can just uninstall that package:
sudo apt remove erlang-mode
As noted in Penguin Brian's answer, this happens when installing erlang-mode on a system using Emacs 23, as erlang-mode only supports Emacs 24 or newer. (Looks like this is a bug in the package: it shouldn't try to compile itself for unsupported Emacs versions.) If you do want to use erlang-mode in Emacs, I'd suggest running Emacs 24 and installing the Erlang mode from MELPA.

Apt-get install package for libmapscript-ruby1.8 not behaving as anticipated

TL;DR: How can I get the right package for libmapscript-ruby1.8 on my system?
Context:
We have found an open source Rails 2.3 app that solves an internal tool problem.
https://github.com/timwaters/mapwarper
Additional instructions
https://github.com/l34marr/mapwarper/blob/master/README#L125
I've some experience with Rails but am just learning about the Ubuntu eco-system and apt-get.
Problem:
The perceived problem is that one of the external libraries (mapscript) is not functioning.
Further detail:
The perceived source of the problem is that apt-get install libmapscript-ruby1.8 does not seem to load a ruby1.8 version of mapscript. Instead it loads to /usr/lib/ruby/vendor_ruby/1.9.1/x86_64-linux/mapscript.so via dependencies of libmapscript-ruby1.8
So when the Rails app links to the installed mapscript.so, it breaks, since the syntax is presumably different between mapscript.so build for 1.8.7 and 1.9.1.
Example error (note 1.9.1 version of mapscript.so is copied into 1.8.7 folder here)
TypeError (wrong argument type swig_runtime_data (expected Struct)):
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/x86_64-linux/mapscript.so
Contact with the application creator has been largely fruitless so far, since they have not encountered this specific issue.
There is a rubygem but it seems to also be for 1.9.1
https://github.com/sourcepole/ruby_mapscript
Is there some apt-get magic that I am missing? I've just read that something called backports exists but don't know if that is a solution.
I know it is an old threat, but in case someone else got this problem, I solved the problem like this:
(I used this github page: https://github.com/normanb/mapserver/tree/master/mapserver/mapscript)
Install old libgif
1.) apt install unzip libgdal-dev swig libproj-dev proj-data proj-bin
2.) wget "http://launchpadlibrarian.net/90361644/libgif4_4.1.6-9ubuntu1_amd64.deb"
3.) sudo dpkg -i libgif4_4.1.6-9ubuntu1_amd64.deb
4.) wget "http://security.ubuntu.com/ubuntu/pool/main/g/giflib/libgif-dev_4.1.6-9ubuntu1_amd64.deb"
5.) sudo dpkg -i libgif-dev_4.1.6-9ubuntu1_amd64.deb
Install old GD
6.) wget "www.boutell.com/gd/http/gd-2.0.33.tar.gz"
7.) unzip
8.) go to folder
9.) ./configure
10.) make
11.) make install
Install webserver
12.) Download zip from https://github.com/normanb/mapserver/
13.) unzip mapserver-master.zip
14.) Goto folder mapserver-master/mapserver/
15.) ./configure --with-wmsclient --with-proj --with-gdal --with-postgis (choose the options you need for your mapscript)
16.) make
For ruby mapscript: (for others chech out https://github.com/normanb/mapserver/tree/master/mapserver/mapscript)
16.) ruby extconf.rb
17.) make
18.) make install
Please note that there is a bug in set filter and you need to comment the filter like so "\"id = 123\"" (https://github.com/mapserver/mapserver/issues/3983)
Ultimately, it appears that the packages are (for my intent and purposes) broken.
Paired with a Debian guru, who basically installed Mapserver on the system in order to compile and generate the correct mapscript.so
He recommended I get in touch with the various package maintainers and outline the problems that I encountered.

ERROR: cannot start RubyMine. No JDK found. JDK Version? + desktop link

ERROR: cannot start RubyMine.
No JDK found. Please validate either RUBYMINE_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
I'm not sure what JDK version number to use to download it?
Also how to create a desktop link in 11.10?
I think using apt-get is easier, see for example this article:
sudo apt-get install openjdk-7-jdk
Turned out that in the end I had to do several things to get java running and thus resolve the issue:
Get Java
Download oracle7 jdk at:
http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
e.g. http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz
Follow instructions at:
http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html
e.g.
After downloading java (above):
Extract the downloaded Oracle Java JDK archive into your home folder and rename the newly created folder to "java-7-oracle".
sudo mv its_name java-7-oracle
Install Java
cd
sudo mkdir -p /usr/lib/jvm/ #just in case
sudo mv java-7-oracle/ /usr/lib/jvm/
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install update-java
sudo update-java # choose version 1.7 if necessary.
Check the Java install
java -version
javac -version
I was then able to start up rubyMine successfully.
Create rubyMine shortcut
To create the desktop launcher in Ubuntu 11.10:
Once you've installed rubymine and you have the executable somewhere:
If it's called mine, then create a desktop launcher that runs it
http://www.ubuntugeek.com/how-to-create-desktop-launchers-in-ubuntu-11-10oneiric.html
You'll run (in a terminal window):
gnome-desktop-item-edit ~/Desktop/ --create-new
Indicate where the rubyMine executable is, e.g. use /usr/local/bin/mine as the command to run.
You can then also drag that to the left side toolbar icons area for a icon quick-launcher there.
Note:
If following these instructions and making a quick-launch icon at the end - make sure NOT to delete the desktop icon you created earlier when cleaning up your desktop as this will also remove that quick-launch item (it's a link to it).

Unable to find Lua headers with find_package in cmake

I'm trying to use CMake to build generate the make file for a project of mine that uses Lua. When I run make I get this error:
/path/to/my/project/luaudio/luaudio.c:1:17: fatal error: lua.h: No such file or directory
In the CMakeLists.txt file, I have the following lines, which I thought would do it, but apparently they're not enough:
find_package(Lua51 REQUIRED)
set(Luaudio_INCLUDE_DIRS ${Luaudio_SOURCE_DIR} ${Lua51_INCLUDE_DIRS} PARENT_SCOPE)
include_directories(${Luaudio_INCLUDE_DIRS})
Lua51_Include_Dirs appears to be empty (attempting to run it though the message command doesn't print anything) so I suspect that it just can't find it. Do I need to specify where to look for Lua? I was under the impression that the whole point of find_package was that it would look in a set a predefined places so that I don't need to specify where it is specifically.
(This is on an Ubuntu machine and I do have the Lua packages installed.)
install lua bin:
sudo apt-get install lua5.1
install lua lib:
sudo apt-get install lua5.1-dev
Exploring FindLua51.cmake from cmake 2.8 I found that it sets LUA_INCLUDE_DIR variable instead of Lua51_INCLUDE_DIRS. So cmake code should be
find_package(Lua51 REQUIRED)
set(Luaudio_INCLUDE_DIRS ${Luaudio_SOURCE_DIR} ${LUA_INCLUDE_DIR} PARENT_SCOPE)
include_directories(${Luaudio_INCLUDE_DIRS})
for Ubuntu 14.04
sudo apt install lua5.2;
sudo apt install liblua5.2-dev;

Resources