LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Java issue must be fixed please help (https://www.linuxquestions.org/questions/linux-server-73/java-issue-must-be-fixed-please-help-865414/)

woodzy 02-28-2011 02:29 AM

Java issue must be fixed please help
 
#1 Ubuntu-10.04-x86_64 (its a form of liunx)
#2 OS 64 bit
#3 java 1.6.0_20
#4 java 64 bit
#5 ERROR below, do you need more info? i dont know what to give for info, if u need more please tell me what to look for

craft: line1: @ECHO: command not found
craft: line2: IF: command not found
craft: line3: IF:command not found
craft: line5: PAUSE: command not found

i need it to look like this below, and load the program called "craft".jar

@ECHO OFF
IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="64" "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xms512M -Xmx512M -jar "%~dp0craft.jar"
IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="86" java -Xms512M -Xmx1000M -jar "%~dp0craft.jar"

PAUSE

unSpawn 02-28-2011 03:17 AM

Not a Java issue but a scripting one:
Code:

case $(uname -i 2>/dev/null) in
 X86_64)
      java -Xms512M -Xmx512M -jar /path/to/craft.jar
      ;;
  i386)
      java -Xms512M -Xmx1000M -jar /path/to/craft.jar
      ;;
    *)
      echo "Dunno what to do with value $(iname -i 2>&1), exiting."
      exit 127
      ;;
esac


woodzy 02-28-2011 12:43 PM

Quote:

Originally Posted by unSpawn (Post 4273687)
Not a Java issue but a scripting one:
Code:

case $(uname -i 2>/dev/null) in
 X86_64)
      java -Xms512M -Xmx512M -jar /path/to/craft.jar
      ;;
  i386)
      java -Xms512M -Xmx1000M -jar /path/to/craft.jar
      ;;
    *)
      echo "Dunno what to do with value $(iname -i 2>&1), exiting."
      exit 127
      ;;
esac



so do i type all of that in?hit enter after each line? yea i just tryed that and it closed my interface....
so i tryed it as a .bat file and i got this error (edited the pater to program)
blah blah, RUN.bat: line 9:command not found, exiting.

unSpawn 03-01-2011 12:43 AM

Quote:

Originally Posted by woodzy (Post 4274223)
so do i type all of that in?hit enter after each line? yea i just tryed that and it closed my interface....
so i tryed it as a .bat file and i got this error (edited the pater to program)
blah blah, RUN.bat: line 9:command not found, exiting.

Code:

#!/bin/bash
JAR="/path/to/craft.jar"
case $(uname -i 2>/dev/null) in
 X86_64) java -Xms512M -Xmx512M -jar "${JAR}";;
  i386) java -Xms512M -Xmx1000M -jar "${JAR}";;
      *) echo "Dunno what to do with value $(iname -i 2>&1), exiting."; exit 127;;
esac
exit 0

0. Save the above script as it is posted here on the Ubuntu machine as "/usr/local/bin/craft.sh",
1. Locate the "craft.jar" on the Ubuntu machine and notice the full path,
2. Change the "/path/to/" in the JAR="/path/to/craft.jar" line to the full path you use for craft.jar,
3. Run 'sudo chmod 0755 /usr/local/bin/craft.sh' to make the script executable,
4. Run "/usr/local/bin/craft.sh" and see if it starts up OK.
5. If it does not start OK post the output of running "/bin/bash -vx /usr/local/bin/craft.sh 2>&1 | tee /tmp/craft.err" (see the "/tmp/craft.err" file).

woodzy 03-14-2011 10:01 PM

didnt work
Quote:

Originally Posted by unSpawn (Post 4274784)
Code:

#!/bin/bash
JAR="/test/craft.jar"
case $(uname -i 2>/dev/null) in
 X86_64) java -Xms512M -Xmx512M -jar "${JAR}";;
  i386) java -Xms512M -Xmx1000M -jar "${JAR}";;
      *) echo "Dunno what to do with value $(iname -i 2>&1), exiting."; exit 127;;
esac
exit 0

0. Save the above script as it is posted here on the Ubuntu machine as "/usr/local/bin/craft.sh",
1. Locate the "craft.jar" on the Ubuntu machine and notice the full path,
2. Change the "/path/to/" in the JAR="/path/to/craft.jar" line to the full path you use for craft.jar,
3. Run 'sudo chmod 0755 /usr/local/bin/craft.sh' to make the script executable,
4. Run "/usr/local/bin/craft.sh" and see if it starts up OK.
5. If it does not start OK post the output of running "/bin/bash -vx /usr/local/bin/craft.sh 2>&1 | tee /tmp/craft.err" (see the "/tmp/craft.err" file).



All times are GMT -5. The time now is 02:08 PM.