elective-stereophonic
elective-stereophonic
java not found singapore
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.12.2

Author Topic: java not found  (Read 2161 times)

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
java not found
« on: August 16, 2014, 09:58:10 pm »

i installed nrs 1.2.5 on new laptop.. downloaded client and java 8, running netbeans fine so java is ok, but nrs says i need to install java.. i assume that it cant find the location of the java files so file path needs to be changed? is that right? if so how do i changed the file path?

any help would be much appreciated..
Logged

rstanaford

  • Jr. Member
  • **
  • Karma: +8/-1
  • Offline Offline
  • Posts: 37
    • View Profile
Re: java not found
« Reply #1 on: August 17, 2014, 02:02:25 am »

If you can confirm that Java works by successfully loading a webpage that requires it, my only guess is the file that you are launching NRS with is indicating the wrong path for the java executable.

Another possibility is you have competing versions of Java if you didn't uninstall the old before installing new.  If it's a Windows machine, try going into Control Panel and see what you find under Java there.



NXT Acct: NXT-6FC9-DGWA-XHFN-765BS
« Last Edit: August 17, 2014, 02:04:43 am by rstanaford »
Logged

Eadeqa

  • Hero Member
  • *****
  • Karma: +83/-68
  • Offline Offline
  • Posts: 1888
    • View Profile
Re: java not found
« Reply #2 on: August 17, 2014, 07:33:16 am »

i installed nrs 1.2.5 on new laptop.. downloaded client and java 8, running netbeans fine so java is ok, but nrs says i need to install java.. i assume that it cant find the location of the java files so file path needs to be changed? is that right? if so how do i changed the file path?

any help would be much appreciated..

http://www.java.com/en/download/help/path.xml
Logged
NXT-GZYP-FMRT-FQ9K-3YQGS

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
Re: java not found
« Reply #3 on: August 17, 2014, 10:51:50 am »

If you can confirm that Java works by successfully loading a webpage that requires it, my only guess is the file that you are launching NRS with is indicating the wrong path for the java executable.

Another possibility is you have competing versions of Java if you didn't uninstall the old before installing new.  If it's a Windows machine, try going into Control Panel and see what you find under Java there.



NXT Acct: NXT-6FC9-DGWA-XHFN-765BS

its a fresh laptop, java wasnt installed on it. i downloaded and ran netbeans just after and it ran perfectly, so java is working fine and netbeans had no issue in finding it so i suspect it is nrs that cannot find java?

it is java 8 i downloaded but that should be backwards compatible for applications that use old versions of java so i cant see that being an issue, but i could be wrong..

@Eadeqa i looked at that previously but tbh iv no idea what im supposed to do..
« Last Edit: August 17, 2014, 10:54:18 am by ForrestGump »
Logged

Eadeqa

  • Hero Member
  • *****
  • Karma: +83/-68
  • Offline Offline
  • Posts: 1888
    • View Profile
Re: java not found
« Reply #4 on: August 17, 2014, 11:06:29 am »

@Eadeqa i looked at that previously but tbh iv no idea what im supposed to do..

What operating system?
Logged
NXT-GZYP-FMRT-FQ9K-3YQGS

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
Re: java not found
« Reply #5 on: August 17, 2014, 11:32:50 am »

@Eadeqa i looked at that previously but tbh iv no idea what im supposed to do..

What operating system?

windows 8
Logged

Eadeqa

  • Hero Member
  • *****
  • Karma: +83/-68
  • Offline Offline
  • Posts: 1888
    • View Profile
Re: java not found
« Reply #6 on: August 17, 2014, 11:37:12 am »

Search for:  SystemPropertiesAdvanced

Then click on "environment variables"

Then double click on "Path"

(found this on google images as an example)



Whatever you see (don't delete anything)  you can add more directories by adding ";"  at the end of it and adding java 8 bin directory. For Example: ;C:\Program Files\Java\jre7\bin

save, but you might have to either log off or reboot for changes to take effect.
« Last Edit: August 17, 2014, 12:07:52 pm by Eadeqa »
Logged
NXT-GZYP-FMRT-FQ9K-3YQGS

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
Re: java not found
« Reply #7 on: August 17, 2014, 12:43:07 pm »

Search for:  SystemPropertiesAdvanced

Then click on "environment variables"

Then double click on "Path"

(found this on google images as an example)



Whatever you see (don't delete anything)  you can add more directories by adding ";"  at the end of it and adding java 8 bin directory. For Example: ;C:\Program Files\Java\jre7\bin

save, but you might have to either log off or reboot for changes to take effect.

restarted computer.. didnt work.. :/

is there not a line in a config file that tells nrs where to find java?
Logged

Eadeqa

  • Hero Member
  • *****
  • Karma: +83/-68
  • Offline Offline
  • Posts: 1888
    • View Profile
Re: java not found
« Reply #8 on: August 17, 2014, 01:06:35 pm »

is there not a line in a config file that tells nrs where to find java?

You can edit run.bat (right click and edit)

and put the right directory where it says "%PROGRAMFILES%\Java\jre7"
 
By the way, what happens when you type java -version from command prompt?  yes, i just realize your system path was just fine (you mentioned path so that's what I was posting about).

You need to edit run.bat. 

 
« Last Edit: August 17, 2014, 01:10:23 pm by Eadeqa »
Logged
NXT-GZYP-FMRT-FQ9K-3YQGS

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
Re: java not found
« Reply #9 on: August 17, 2014, 01:10:18 pm »

is there not a line in a config file that tells nrs where to find java?

You can edit run.bat (right click and edit)

and put the right directory where it says "%PROGRAMFILES%\Java\jre7"
 
By the way, what happens when you type java -version from command prompt?

thanks will try that now..

Logged

Eadeqa

  • Hero Member
  • *****
  • Karma: +83/-68
  • Offline Offline
  • Posts: 1888
    • View Profile
Re: java not found
« Reply #10 on: August 17, 2014, 01:14:31 pm »

is there not a line in a config file that tells nrs where to find java?

You can edit run.bat (right click and edit)

and put the right directory where it says "%PROGRAMFILES%\Java\jre7"
 
By the way, what happens when you type java -version from command prompt?

thanks will try that now..



Yes, sorry your environment variables are fine. Just edit run.bat or type java -cp nxt.jar;lib\*;conf nxt.Nxt (from nxt directory)




 
Logged
NXT-GZYP-FMRT-FQ9K-3YQGS

petko

  • Full Member
  • ***
  • Karma: +24/-0
  • Offline Offline
  • Posts: 100
    • View Profile
    • My blog
Re: java not found
« Reply #11 on: August 17, 2014, 01:24:50 pm »

Yes, there is a mistake in run.bat: "IF EXIST java" will not be true unless there is "java" file in the current directory. Batch is not that smart to search the system dirs or PATH :)

The guys who manage run.bat: try this approach - http://stackoverflow.com/a/4781795
Logged

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
Re: java not found
« Reply #12 on: August 17, 2014, 01:33:49 pm »

yup worked fine.. thanks for that...


the run.bat file is only set to include java 7, it needs to be changed to check for java 8 also otherwise you end up with the issue i had..

Logged

Eadeqa

  • Hero Member
  • *****
  • Karma: +83/-68
  • Offline Offline
  • Posts: 1888
    • View Profile
Re: java not found
« Reply #13 on: August 17, 2014, 01:37:55 pm »

yup worked fine.. thanks for that...


the run.bat file is only set to include java 7, it needs to be changed to check for java 8 also otherwise you end up with the issue i had..

see petko post above. There is error in run.bat.

IF EXIST java

will not check the path. It only check the current directory for java.exe. You would have not have problem with Java 8 if that part was correct, as java is in your PATH environment variable.

Logged
NXT-GZYP-FMRT-FQ9K-3YQGS

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
Re: java not found
« Reply #14 on: August 17, 2014, 01:44:48 pm »

yup worked fine.. thanks for that...


the run.bat file is only set to include java 7, it needs to be changed to check for java 8 also otherwise you end up with the issue i had..

see petko post above. There is error in run.bat.

IF EXIST java

will not check the path. It only check the current directory for java.exe. You would have not have problem with Java 8 if that part was correct, as java is in your PATH environment variable.
it is cos it searches %programfiles%\java\bin\java7

it's not the path that's the issue cos it searches both programfiles and programfiles(86x). the issue (with me) is it only searches for java 7 with out allowing java 8 to satisfy the search criteria.

Sent from my C1905 using Tapatalk

Logged

Eadeqa

  • Hero Member
  • *****
  • Karma: +83/-68
  • Offline Offline
  • Posts: 1888
    • View Profile
Re: java not found
« Reply #15 on: August 17, 2014, 01:53:53 pm »


it is cos it searches %programfiles%\java\bin\java7

it's not the path that's the issue cos it searches both programfiles and programfiles(86x). the issue (with me) is it only searches for java 7 with out allowing java 8 to satisfy the search criteria.

No, first it looks for "Java" (without any directory). Only after that fails, it looks for %programfiles%\java\bin\java7. Given Java 8 installation would have set the path automatically, you would not have encountered this problem anyway if it was  checking the path.
Logged
NXT-GZYP-FMRT-FQ9K-3YQGS

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
Re: java not found
« Reply #16 on: August 17, 2014, 01:55:18 pm »


it is cos it searches %programfiles%\java\bin\java7

it's not the path that's the issue cos it searches both programfiles and programfiles(86x). the issue (with me) is it only searches for java 7 with out allowing java 8 to satisfy the search criteria.

No, first it looks for "Java" (without any directory). Only after that fails, it looks for %programfiles%\java\bin\java7. Given Java 8 installation would have set the path automatically, you would not have encountered this problem anyway if it was  checking the path.
ah ok so..

Sent from my C1905 using Tapatalk

Logged

Jean-Luc

  • Core Dev
  • Hero Member
  • *****
  • Karma: +816/-81
  • Offline Offline
  • Posts: 1610
    • View Profile
Re: java not found
« Reply #17 on: August 17, 2014, 04:51:02 pm »

I don't use Windows, if anyone submits a corrected and verified to work version of run.bat, I will include it.
Logged
GPG key fingerprint: 263A 9EB0 29CF C77A 3D06  FD13 811D 6940 E1E4 240C
NXT-X4LF-9A4G-WN9Z-2R322

petko

  • Full Member
  • ***
  • Karma: +24/-0
  • Offline Offline
  • Posts: 100
    • View Profile
    • My blog
Re: java not found
« Reply #18 on: August 17, 2014, 07:50:03 pm »

This one works for me

Code: [Select]
@ECHO OFF

for %%X in (java.exe) do (set IS_JAVA_IN_PATH=%%~$PATH:X)

IF defined IS_JAVA_IN_PATH (
start "NXT NRS" java -cp nxt.jar;lib\*;conf nxt.Nxt
) ELSE (
IF EXIST "%PROGRAMFILES%\Java\jre7" (
start "NXT NRS" "%PROGRAMFILES%\Java\jre7\bin\java.exe" -cp nxt.jar;lib\*;conf nxt.Nxt
) ELSE (
IF EXIST "%PROGRAMFILES(X86)%\Java\jre7" (
start "NXT NRS" "%PROGRAMFILES(X86)%\Java\jre7\bin\java.exe" -cp nxt.jar;lib\*;conf nxt.Nxt
) ELSE (
ECHO Java software not found on your system. Please go to http://java.com/en/ to download a copy of Java.
PAUSE
)
)
)

Logged

kodtycoon

  • Hero Member
  • *****
  • Karma: +43/-18
  • Offline Offline
  • Posts: 916
    • View Profile
Re: java not found
« Reply #19 on: August 17, 2014, 08:38:36 pm »

This one works for me

Code: [Select]
@ECHO OFF

for %%X in (java.exe) do (set IS_JAVA_IN_PATH=%%~$PATH:X)

IF defined IS_JAVA_IN_PATH (
start "NXT NRS" java -cp nxt.jar;lib\*;conf nxt.Nxt
) ELSE (
IF EXIST "%PROGRAMFILES%\Java\jre7" (
start "NXT NRS" "%PROGRAMFILES%\Java\jre7\bin\java.exe" -cp nxt.jar;lib\*;conf nxt.Nxt
) ELSE (
IF EXIST "%PROGRAMFILES(X86)%\Java\jre7" (
start "NXT NRS" "%PROGRAMFILES(X86)%\Java\jre7\bin\java.exe" -cp nxt.jar;lib\*;conf nxt.Nxt
) ELSE (
ECHO Java software not found on your system. Please go to http://java.com/en/ to download a copy of Java.
PAUSE
)
)
)


confirmed. also works for me..

just saw JL's comments.. thanks JL.
« Last Edit: August 17, 2014, 08:40:42 pm by ForrestGump »
Logged
 

elective-stereophonic
elective-stereophonic
assembly
assembly