Go to Post everybody wants a piece of success! - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-24-2016, 11:48 AM
mkmeral mkmeral is offline
Registered User
FRC #4191
 
Join Date: Feb 2016
Location: Turkey
Posts: 6
mkmeral is an unknown quantity at this point
Roborio Connecting to Raspberry Pi

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"
Reply With Quote
  #2   Spotlight this post!  
Unread 12-24-2016, 01:01 PM
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 298
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Roborio Connecting to Raspberry Pi

Install a JDK
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #3   Spotlight this post!  
Unread 12-24-2016, 01:12 PM
mkmeral mkmeral is offline
Registered User
FRC #4191
 
Join Date: Feb 2016
Location: Turkey
Posts: 6
mkmeral is an unknown quantity at this point
Re: Roborio Connecting to Raspberry Pi

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
Reply With Quote
  #4   Spotlight this post!  
Unread 12-24-2016, 02:12 PM
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 298
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Roborio Connecting to Raspberry Pi

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
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #5   Spotlight this post!  
Unread 12-25-2016, 02:26 PM
JamieSinn's Avatar
JamieSinn JamieSinn is offline
Student Mentor
FRC #1334 (Red Devils)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2009
Location: Canada
Posts: 12
JamieSinn is an unknown quantity at this point
Re: Roborio Connecting to Raspberry Pi

What is the stacktrace of the error? Without that we can't tell what the problem is.
Reply With Quote
  #6   Spotlight this post!  
Unread 12-25-2016, 05:54 PM
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 298
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Roborio Connecting to Raspberry Pi

Quote:
Originally Posted by mkmeral View Post
Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:\Program Files\Java\jre1.8.0_111"
Quote:
Originally Posted by JamieSinn View Post
can't tell what the problem is
What?
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:21 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi