0

I'm following this tutorial on how to build an Android Plugin for Unity

I'm currently at the part where the author tells me to do the following in command line:

1.> javac CompassActivity.java -classpath C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar -bootclasspath C:\android-sdk-windows\platforms\android-8\android.jar -d .

2.> javap -s com.yourcompany.yourgamename.CompassActivity

3.> jar cvfM ../Compass.jar com/

However when I type the following line:

javac CompassActivity.java -classpath C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar

I get the following message:

javac: invalid flags: (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar
usage: javac <options> <source files>
use -help for a list of possible options

So I've tried retyping the line putting my path of the file in angled brackets, placing a dot in between classpath and the start of my file location, but I keep getting the same issue.

Am I using classpath wrong?

If so, what is the correct way I should be doing it?

I should add that the console does point to the correct folder location. That was the first thing I've checked.

2
  • try putting the path between "" like "c:\progra..." Commented Dec 9, 2013 at 12:17
  • 2
    Try enclosing the path with "s like "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar" Commented Dec 9, 2013 at 12:17

4 Answers 4

1

There are spaces in the path to classes.jar, you must enclose it using ", or shell will consider it as three distinct parameters (C:\Program, Files and (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar"):

javac CompassActivity.java -classpath "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar"
Sign up to request clarification or add additional context in comments.

Comments

0

You must try the command like:

usage: javac <options> <source files>

javac -classpath "C:\Program Files (x86)\Unity\Editor\Data\PlaybackEngines\androidplayer\bin\classes.jar" CompassActivity.java

Comments

0

First Check your System is 32-bit or 64-bit

check it out full steps for Config and run:http://introcs.cs.princeton.edu/java/15inout/windows-cmd.html

Comments

0

USe

javac -cp filepath 

or you also try to set the classpath first by command

set classpath="filepath"

Then u can try with a command

java filepath

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.