Yritän tehdä oman bootin seuraamalla ohjeet sivulla:
http://www.jibble.org/pircbot.php
Olen tehnyt hakemiston ohjelmalle, hain pircbot.jar tiedoston, tein kaksi *.java tiedostoa niin kuin ohjeessa lukee, mutta käännös ei onnistu:
$ javac -classpath pircbot.jar;. *.java
javac: no source files
Usage: javac
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath Specify where to find user class files
-sourcepath Specify where to find input source files
-bootclasspath Override location of bootstrap class files
-extdirs Override location of installed extensions
-d Specify where to place generated class files
-encoding Specify character encoding used by source files
-source Provide source compatibility with specified release
-target Generate class files for specific VM version
-help Print a synopsis of standard options
import: unable to open X server `'.
-bash: public: command not found
-bash: MyBot.java: line 5: syntax error near unexpected token `('
-bash: MyBot.java: line 5: ` public MyBot() {'
Voiko tuo pircbot.jar tunkea jonnekin javan omaan kirjastohakemistoon, niin että se toimisi aina?
Minulla on Linux eikä Windows voiko ongelma olla siinä?
http://www.jibble.org/pircbot.php
Olen tehnyt hakemiston ohjelmalle, hain pircbot.jar tiedoston, tein kaksi *.java tiedostoa niin kuin ohjeessa lukee, mutta käännös ei onnistu:
$ javac -classpath pircbot.jar;. *.java
javac: no source files
Usage: javac
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath Specify where to find user class files
-sourcepath Specify where to find input source files
-bootclasspath Override location of bootstrap class files
-extdirs Override location of installed extensions
-d Specify where to place generated class files
-encoding Specify character encoding used by source files
-source Provide source compatibility with specified release
-target Generate class files for specific VM version
-help Print a synopsis of standard options
import: unable to open X server `'.
-bash: public: command not found
-bash: MyBot.java: line 5: syntax error near unexpected token `('
-bash: MyBot.java: line 5: ` public MyBot() {'
Voiko tuo pircbot.jar tunkea jonnekin javan omaan kirjastohakemistoon, niin että se toimisi aina?
Minulla on Linux eikä Windows voiko ongelma olla siinä?
Vastaukset 3
Vanhimmat
linuxissä käytetään kaksoispistettä (:) eikä (;) kuten windowsissa.
Kiitos, nyt toimii !
Mutta voiko tuon kirjaston kopioida jonnekin PATHiin, että se olisi automaattisesti aina käytettävissä?
no voit kopsata sen $JAVA_HOME/jre/lib/ext. Tai sit jonnekkiin omaan kansioon ja määrität CLASSPATH:n ja sit vaikka näin: export CLASSPATH=.:$HOME/libs/test.jar:$HOME/libs/kirjasto.jar
huomaa piste alussa.
Itse käytän / ja suosittelen sullekkin tekemään softat jollain työkalulla joka tekee kaikki tommoset mahdolliman automaatisiksi.