Log in

View Full Version : Roborio Connecting to Raspberry Pi


mkmeral
24-12-2016, 11:48
I am right now trying to get message from raspberry pi using roborio(java). I have configured Raspberry as web server, and i access to a file from it. In my computer (not wpilib) it works, I can get the data as I should normally do. However, when, try to upload the code below to the roborio i get the error below. Any suggestions? public void networking(){ // TODO Auto-generated method stub

try{
String wholetext = "";
URL oracle = new URL("http://10.41.91.109/a");
URLConnection yc = oracle.openConnection();
BufferedReader in;
in = new BufferedReader(new InputStreamReader(
yc.getInputStream()));

String inputLine;
while ((inputLine = in.readLine()) != null)
wholetext += inputLine;
in.close();
SmartDashboard.putString("Deger", wholetext);
}catch(Exception e){
SmartDashboard.putString("NETWORK:", e.getMessage());
}

}

BUILD FAILED C:\Users___\wpilib\java\current\ant\build.xml:71: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre1.8.0_111"

euhlmann
24-12-2016, 13:01
Install a JDK (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

mkmeral
24-12-2016, 13:12
It's already installed. I am also developing other apps on this pc, and they work fine. Also I tried the same code on eclipse console (java app) and it worked.So I do not think there's problem with jdk. Also without the jdk installed, eclipse gives an error at startup

euhlmann
24-12-2016, 14:12
Ok, then you just need to fix your environment variables. Change JAVA_HOME to the location of your jdk (C:\Program Files\Java\jdk_<version>). Then you should probably also edit your PATH for good measure: remove C:\Program Files\Java\jre_<version>\bin if it's there and add C:\Program Files\Java\jdk_<version>\bin and C:\Program Files\Java\jdk_<version>\jre\bin

JamieSinn
25-12-2016, 14:26
What is the stacktrace of the error? Without that we can't tell what the problem is.

euhlmann
25-12-2016, 17:54
Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre1.8.0_111"
can't tell what the problem is
What?