The Gramm
The Gramm

Reputation: 118

Error compiling Java from command line

I am doing a Friend Suggester application in Java using Hadoop 2.7.2 (latest atm) and I just finished the code. I want to compile the .java file and create the .class files but when I run the command

javac -d "/home/gramanas/" -cp "/srv/hadoop/share/hadoop/common/hadoop-common-2.7.2.jar:/srv/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.7.2.jar:/usr/lib/jvm/java-1.7.0-openjdk-amd64" FriendSuggest.java 

I get the following error:

FriendSuggest.java:63: error: 
error while writing FriendMapper: /home/gramanas/FriendSuggest$FriendMapper.class
    public static class FriendMapper
                  ^

I don't think it has something to do with the code since it compiles normally in IDEA. I want to compile it from command line but I can't get it to work.

What is the problem? How can I fix it?

Additional Info:

Upvotes: 1

Views: 321

Answers (1)

Loris Securo
Loris Securo

Reputation: 7638

That type of error might be caused by not having writing permissions on the path you are executing the compilation.

You should try to compile where/when you are sure to have such permissions.

Upvotes: 2

Related Questions