New answers tagged

1

I'm unsure whether Spark will work with Java 7, but if not the obvious solution is to install Java 8: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer Answering "yes" in the correct spots should get you Java 8 as default, otherwise sudo update-java-alternatives -s java-8-oracle will do the ...


0

If you want to run a .jar file... "like minecraft" then java -jar minecraft.jar


1

Java itself is just "possibility to run" any java-code, programm, e.t.c If you try to start in command line java -version usually you will see the version of installed Java-Interpreter. To start "something" you have to put java-class-name additionally, possible with parameters, for example: java my.first.JavaTest Hello For more info try to look into ...


2

You need to add $JAVA_HOME/bin to your PATH You can verify this easily: $ PATH=$PATH:$JAVA_HOME/bin $ java -version After you've verified it works, edit your ~/.bashrc file to include the line export PATH=$PATH:$JAVA_HOME/bin


0

apt-get install the packages from the http://packages.ubuntu.com/ repository. Ubuntu cache all the packages metadata in the computer. You can search your packages using the following command. sudo apt-cache search "package keyword" search the HDF5 library in the ubuntu package repository. sudo apt-cache search "hdf5" The command will show the packages ...


0

Programs started from the Ubuntu launcher do not read .bashrc. As an alternative to setting the paths in PyCharm, you can simply start PyCharm from a Bash shell to give it access to the environment variables you set in .bashrc.


1

Actually this is a great question for Unix & Linux because it is not only related to Ubuntu. There is a really nice answer on SuperUser which describes the Difference between .bashrc, .bash_profile and .profile. The accepted answer explains this pretty well. Here are some relevant parts from that answer: Bash is a Bourne-like shell. It reads ...


2

Read the man page of the program you are trying to influence with an environment variable. For PROMPT_COMMAND it's man bash. Since programs generally use all upper case environment variables, and environment variables are passed to programs as strings, (in the env array, along with the argv array) and accessed by name, you can generate a list including all ...


2

how was PROMPT_COMMAND chosen to get the job done PROMPT_COMMAND is one of the variables specific to bash, which runs its value as a command before printing your $PS1 prompt on screen. By default it's unset. How to make out setting what env. variable would get the job done By reading the man page of bash, man bash in terminal. There is list of ...


2

If you're using bash as your default shell, you can indeed set PROMPT_COMMAND. You usually find hints or detailed guidelines in the manual pages of a command (online from the bash man page) or by typing man bash for example: PROMPT_COMMAND If set, the value is executed as a command prior to issuing each primary prompt. I did propose another solution ...


2

It looks like you edited this code snippet: if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi which is included in ~/.profile by default. The answer which lead you to do so is confusing IMNSHO. I'd suggest that you change that code back to what it looked like before, and instead add a new line underneath it: if [ -d "$HOME/bin" ] ; then ...


0

OK, there's a couple issues here: Use echo $PATH instead of $PATH to check it! The reason for this is that bash replaces $PATH with the contents of that variable everywhere, so just running $PATH tries to execute the contents of the variable, which is nonsense to hte bash interpreter. You should add the content you added to ~/.profile to ~/.bashrc as ...


0

I figured it out. It was ridiculous mistake by me. As I set JAVA_HOME in so many files, in all the mess I set it to /usr/lib/jvm/java-7-openjdk-amd64 in ~/.bashrc. So every time I opened the terminal it changed to this no matter what was in all the other files, as ~/.bashrc runs every time teminal is opened.


2

You should not set this yourself, if it can be helped. To change which Java version to use, see this guide. Snippet: If your system has more than one version of Java, configure which one your system uses by entering the following command in a terminal window sudo update-alternatives --config java This will present you with a selection that ...


1

Login to your account and open .bash_profile file $ vi ~/.bash_profile Set JAVA_HOME as follows using syntax export JAVA_HOME=<path-to-java-bin-directory>/java If you want changes effected without logout, enter command below: $ source ~/.bash_profile


1

You can use two for loops i.e. one for y and one for x (or while/until in the y's loop i.e. the outer loop): #!/bin/bash for ((y=0; y<12345; y++)); do for ((x=40000; x<180000; x++)); do dd bs=1 if=static.file of=extracted${x}.file skip=12345 count=$x; first_ten=$(hexdump -e '1/1 "%.2X"' "extracted${x}.file" | head -c 10); ...


1

If you mean you want to test both variables use && operator and another test until [ $x -eq 180000" ] && [ $y -eq 9999 ]; do


3

The fact that PATH is not sourced from ~/.profile has 2 very good reasons behind it: Only login shells source ~/.profile. So that's not expected to be sourced in a normal terminal. If you're unable to get it to work in a login shell that's because Zsh sources ~/.zprofile, not ~/.profile. The fact that the changes are lost after sourcing ~/.profile is ...


0

Going through the basics, I will suggest the following steps: 1. It's recommended to set environment variables in /etc/environment 2. Open the file as superuser in an editor as it's a read only file e.g. gedit: gksu gedit /etc/environment 3. System will need password to open it in editable mode. Enter your superuser password and get file opened in a new ...


0

you might double check if your JDK is x84 or x64. If the version is a wrong one, ubuntu then cannot read it and it will tells you "No such file or directory"



Top 50 recent answers are included