Start sh 1 java not found

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/bin/sh: java: command not found. but only with Python 3? #3

/bin/sh: java: command not found. but only with Python 3? #3

Comments

Performing unit tests on remote machine when errors began occurring when running with Python 3.5.2 but not with Python 2.7.12.

train_output.txt and test_output.txt each contained:
/bin/sh: java: command not found

I adapted the java -jar v1-0.jar calls in boostsrl.py to have absolute paths based on where java was installed.

Unittests still took quite a while after command python3 tests/tests.py was ran, I killed it after waiting.

[hayesall@tank boostsrl-python-package]$ python3 tests/tests.py . ^CE.. ====================================================================== ERROR: test_boostsrl_testing (__main__.MyTest) Run the entire training/testing pipeline to ensure testing works properly. ---------------------------------------------------------------------- Traceback (most recent call last): File "./boostsrl/boostsrl.py", line 47, in call_process os.waitpid(p.pid, 0) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "tests/tests.py", line 169, in test_boostsrl_testing results = f.test_testing_1() File "tests/tests.py", line 63, in test_testing_1 results = boostsrl.test(model, test_pos, test_neg, test_facts) File "./boostsrl/boostsrl.py", line 192, in __init__ call_process(CALL) File "./boostsrl/boostsrl.py", line 49, in call_process raise(Exception('Encountered problems while running process: ', call)) Exception: ('Encountered problems while running process: ', '(cd boostsrl; /usr/bin/java -jar v1-0.jar -i -model train/models/ -test test/ -target cancer -trees 10 -aucJarPath . > test_output.txt 2>&1)') ----------------------------------------------------------------------

Checking boostsrl/test_output.txt revealed a lock was created on aucTemp.txt

% Computing Area Under Curves. %Pos=3 %Neg=2 %LL:-0.38078705156403625 %LL:-1.1159182524360722 Lock file test/AUC/.aucTemp.txt.lock already exists. Waiting 1 milliseconds to obtain lock. Lock file test/AUC/.aucTemp.txt.lock already exists. Waiting 1 milliseconds to obtain lock. Lock file test/AUC/.aucTemp.txt.lock already exists. Waiting 1 seconds to obtain lock.

After removing the lock, I was able to run training, but auc calculation still crashed.

% Computing Area Under Curves. %Pos=3 %Neg=2 %LL:-0.38078705156403625 %LL:-1.1159182524360722 % Running command: java -jar ./auc.jar test/AUC/aucTemp.txt list 0.0 java.io.IOException: Cannot run program "java": error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:620) at java.lang.Runtime.exec(Runtime.java:450) at java.lang.Runtime.exec(Runtime.java:347) at edu.wisc.cs.will.DataSetUtils.ComputeAUC.computeAUCFromJar(ComputeAUC.java:180) at edu.wisc.cs.will.DataSetUtils.ComputeAUC.init>(ComputeAUC.java:99) at edu.wisc.cs.will.Boosting.RDN.InferBoostedRDN.computeAUCFromEg(InferBoostedRDN.java:497) at edu.wisc.cs.will.Boosting.RDN.InferBoostedRDN.getF1ForEgs(InferBoostedRDN.java:417) at edu.wisc.cs.will.Boosting.RDN.InferBoostedRDN.processExamples(InferBoostedRDN.java:224) at edu.wisc.cs.will.Boosting.RDN.InferBoostedRDN.runInference(InferBoostedRDN.java:161) at edu.wisc.cs.will.Boosting.RDN.RunBoostedRDN.infer(RunBoostedRDN.java:457) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.inferModel(RunBoostedModels.java:163) at edu.wisc.cs.will.Boosting.RDN.RunBoostedRDN.runJob(RunBoostedRDN.java:49) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.main(RunBoostedModels.java:220) Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.init>(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) . 13 more Exception in thread "main" edu.wisc.cs.will.Utils.WILLthrownError: Problem running: java -jar ./auc.jar test/AUC/aucTemp.txt list 0.0 at edu.wisc.cs.will.Utils.Utils.error(Utils.java:484) at edu.wisc.cs.will.DataSetUtils.ComputeAUC.computeAUCFromJar(ComputeAUC.java:217) at edu.wisc.cs.will.DataSetUtils.ComputeAUC.init>(ComputeAUC.java:99) at edu.wisc.cs.will.Boosting.RDN.InferBoostedRDN.computeAUCFromEg(InferBoostedRDN.java:497) at edu.wisc.cs.will.Boosting.RDN.InferBoostedRDN.getF1ForEgs(InferBoostedRDN.java:417) at edu.wisc.cs.will.Boosting.RDN.InferBoostedRDN.processExamples(InferBoostedRDN.java:224) at edu.wisc.cs.will.Boosting.RDN.InferBoostedRDN.runInference(InferBoostedRDN.java:161) at edu.wisc.cs.will.Boosting.RDN.RunBoostedRDN.infer(RunBoostedRDN.java:457) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.inferModel(RunBoostedModels.java:163) at edu.wisc.cs.will.Boosting.RDN.RunBoostedRDN.runJob(RunBoostedRDN.java:49) at edu.wisc.cs.will.Boosting.Common.RunBoostedModels.main(RunBoostedModels.java:220)

Additional information that may be useful when trying to reproduce:

$ hostname tank.soic.indiana.edu $ which python --> ~/anaconda2/bin/python $ which python2 --> ~/anaconda2/bin/python2 $ which python3 --> /usr/local/bin/python3 $ which java --> /usr/bin/java

The text was updated successfully, but these errors were encountered:

Источник

./run.sh: line 1: java: command not found

If this errors out you did not install «java» and the program depends on it.

sudo apt-get install openjdk-8-jre 

would install Open JDK 8 and make the script work.

sudo apt-get install openjdk-6-jre sudo apt-get install openjdk-7-jre 

for version 6 or 7 but 8 should be the best one.

For Ubuntu 14.04 you will need

sudo apt-get install openjdk-6-jre 

How to Run JAVA in Visual Studio Code on Windows 10 2022

Linux add to $PATH: Fix

How to Install SSH in powershell and cmd (Windows 7,8,10)

HowTo Fix Code command not found| Open bash_profile in Visual Studio Code

Ubuntu: ./run.sh: line 1: java: command not found

Visual studio code error JAVA_Home is not set and no 'java' command could be found in your path

How to Compile and Run Java Program from Command Prompt

copser

copser

God forbid we have to move our fingers away from the hjkl position.

Updated on September 18, 2022

Comments

copser

I’m trying to install worksnaps client so I can start working on a project. I’m running Ubuntu 14.04 LTS 32bit system. Installation and Configuration for worksnaps are simple :

Download the Worksnaps Client package. The package is in zip format. With the user login that is going to use the Worksnaps Client, run the command «unzip WSClient_linux_.zip» to unzip the package. You should be able to see a directory «Worksnaps» created. Execute command «cd Worksnaps/bin» Execute command «chmod +x run.sh» Execute command «chmod +x p.sh» Launch the Worksnaps Client by executing command «./run.sh» (Note: please do not click any Jar file to launch the program.)

./run.sh: line 1: java: command not found 

Link to the instruction’s for worksnaps .They said here Worksnaps client version 1.1.20140511 or newer runs on both 64-bit or 32-bit Java environment. On a 64-bit Linux system, 64-bit Java environment is preferred. But they are not specific about what version does not working, I assume you can install both on 32-bit and 64-bit system, and there is just one version to download `worksnaps verison 1.1.201440511′. Can someone help me overcome this.

Источник

Minecraft Forums

debian ./start.sh: line 2: java: command not found URGENT HELP PLEASE

  • Redstone Miner
  • Location: Perth
  • Join Date: 10/19/2010
  • Posts: 578
  • Minecraft: XLawlessBaronX
  • Xbox: XLawless BaronX
  • Member Details

I go to start start.sh but i get this

./start.sh: line 2: java: command not found

Does anyone know what i can do so that the java will work as a command i installed java but i think there is something missing help anyone ?

please can someone help me

i am running Debian 6 x64

i need a proper install for java

  • Redstone Miner
  • Location: Perth
  • Join Date: 10/19/2010
  • Posts: 578
  • Minecraft: XLawlessBaronX
  • Xbox: XLawless BaronX
  • Member Details

I have done all that but i still get the error
is there anything in particular i need in the script ?

  • Redstone Miner
  • Location: Perth
  • Join Date: 10/19/2010
  • Posts: 578
  • Minecraft: XLawlessBaronX
  • Xbox: XLawless BaronX
  • Member Details
  • Redstone Miner
  • Location: Perth
  • Join Date: 10/19/2010
  • Posts: 578
  • Minecraft: XLawlessBaronX
  • Xbox: XLawless BaronX
  • Member Details

java -Xincgc -Xmx3048M -jar craftbukkit.jar

  • Redstone Miner
  • Location: Perth
  • Join Date: 10/19/2010
  • Posts: 578
  • Minecraft: XLawlessBaronX
  • Xbox: XLawless BaronX
  • Member Details
bukkit_start.sh: line 3: java: command not found

View notacceptable's Profile

OK. I would recommend that you install the sun jre.

To do this you need to enable non-free repositories.

You need to add these to your sources file (use whatever editor you like, I use nano):

deb http://ftp.debian.org/debian/ squeeze contrib non-free deb-src http://ftp.debian.org/debian/ squeeze contrib non-free deb http://security.debian.org/debian/ squeeze/updates contrib non-free deb-src http://security.debian.org/debian/ squeeze/updates contrib non-free

Then save the file, (Ctrl+O in nano).

apt-get update apt-get install sun-java6-jre
  • Redstone Miner
  • Location: Perth
  • Join Date: 10/19/2010
  • Posts: 578
  • Minecraft: XLawlessBaronX
  • Xbox: XLawless BaronX
  • Member Details

i get this after trying to update i get this

Reading package lists. Done Building dependency tree Reading state information. Done Package sun-java6-jre is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package sun-java6-jre has no installation candidate

and some of those links dont work tried it when updated

View notacceptable's Profile

i get this after trying to update i get this

Reading package lists. Done Building dependency tree Reading state information. Done Package sun-java6-jre is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package sun-java6-jre has no installation candidate

and some of those links dont work tried it when updated

Did you do the apt-get update ? I misspelled it in my above post. If so, not sure what the issue is. I just tried this on my squeeze server and it worked.

Источник

Как прописать путь до Java в исполняемом файле .sh

Добрый день форумчане, на Ubuntu 20.04 есть приложение которое использует Java 8, запускается оно через файл start.sh в котором прописаны конфиги, на самой машине пришла необходимость по умолчанию использовать Java 16. Теперь приложение которое использует Java 8 по умолчанию обращается через Java 16, как правильно в файле start.sh прописать чтобы это приложение использовало Java 8?

P/S Погуглив везде рассказывают о том как установить определённую Java по умолчанию или для определённого пользователя.

Ты можешь напрямую дёргать бинарь java:

#!/bin/sh /usr/local/openjdk8/bin/java -jar ./path/to/your.jar $* 

Пути поправишь как надо, в Ubuntu они другие.

Разве эта переменная не для обёртки-«переключателя» java?

Стандартов тут нет, поэтому универсальный ответ — изучай файл start.sh и разбирайся, как там устроен поиск java.

Обычно используют JAVA_HOME, если он не задан, то ищут java в $PATH . Поэтому для надёжности можно сделать так:

export JAVA_HOME="xxx" PATH="$JAVA_HOME/bin":$PATH ./start.sh 

Скорей всего этого хватит. Может быть и одного из этих пунктов хватит.

У меня установлена Java 8. С ней падает лаунчер Minecraft на процессорах AMD Athlon II, Phenom II и AMD FX. Падает с ошибкой Webkit, а вернее библиотеки из состава Java, реализующей отображение веб-контента.

То же самое с Java 7. Только с Java 6 лаунчер нормально работает.

#!/bin/sh /home/zenitur/bin/jre1.6.0_45/bin/java -jar /home/zenitur/bin/launcher.jar 

А сама игра запускается с Java 8 (можно в настройках профиля указать путь к Java 8, но по-моему там изначально так и было).

Просто замени в скрипте путь к бинарнику Java, укажи конкретно путь к Java 8.

Дак в том то и вопрос поста, как правильно это прописать)

В скрипте, скорее всего, просто бинарник «java» вызывается. Заменяшь «java» на «/usr/lib/jvm/java-8-openjdk/jre/bin/java», или где у тебя там Java 8 лежит. Готово.

Так вроде получилось, благодарю!

Источник

Читайте также:  Php iconv oem 866
Оцените статью