Error Package Com.jcraft.jsch Does Not Exist
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might
Jsch.jar Free Download
have Meta Discuss the workings and policies of this site About java ssh Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Grails - import jsch results in “package com.jcraft.jsch does not exist” up vote 0 down vote favorite 2 I'm porting some java code into GRAILS framework and I keep getting this error when importing libraries (jcraft): import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.JSch; import com.jcraft.jsch.Session; import com.jcraft.jsch.ChannelSftp.LsEntry; MyServiceImpl.java:47: package com.jcraft.jsch does not exist [groovyc] import com.jcraft.jsch.*; [groovyc] ^ I've tried adding this to 'BuildConfig.groovy', but still same error. dependencies { compile 'com.jcraft:jsch:0.1.43' Any idea what I need to add? I also added the actual jar file in the Build path library. Many thanks. java grails import share|improve this question edited May 25 '11 at 8:03 oliholz 5,68322863 asked May 25 '11 at 7:30 ibaralf 5,67332338 do you have any repository-related error ? They specify a particular repo on the JSCH site –Grooveek May 25 '11 at 8:29 No, I didn't see any errors. –ibaralf May 26 '11 at 17:23 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted have you tried to copy this library into the lib folder of the grails-app structure and removed all refernces from e.g. BuildConfig.groovy ... i can also try to unpack the library and check if the lib
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Jsch on Ubuntu 12.04 import statement up vote 0 down vote favorite I http://stackoverflow.com/questions/6120972/grails-import-jsch-results-in-package-com-jcraft-jsch-does-not-exist am trying to use the jsch package, to test its scp capability inside Java. I tried to install libjsch-java via apt-get to find it was already installed. When I tried to compile the script on this page it said the package does not exist: ScpTo.java:11: package com.jcraft.jsch does not exist Am I doing something wrong? It seems the library is installed but perhaps it needs to be called using a http://stackoverflow.com/questions/22667039/jsch-on-ubuntu-12-04-import-statement different name. How can I find out what name I need to use please? Or is there a different problem I have not considered? java jsch share|improve this question asked Mar 26 '14 at 16:16 user3465120 32 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote Add the jar file to your classpath. If you are compiling with command line add -cp path/jsch.jar to your command line. If you are working with IDE add the jar using tools it provides. share|improve this answer answered Mar 26 '14 at 16:18 AlexR 82.2k366127 I tried as you suggested (I am compiling at command line), and got the same error... –user3465120 Mar 26 '14 at 17:10 Please post more details. I guess this is your first java experience. You are trying to do a trivial thing. If it does not work and you are expecting relevant help please give us more details. –AlexR Mar 26 '14 at 19:09 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posti
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn http://stackoverflow.com/questions/16026355/adding-external-jars-to-an-android-uiautomator-project more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community http://ideone.com/JKDpxv Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Adding external jars to an Android UIautomator project up vote error package 4 down vote favorite 1 There seem to be a decent number of questions about adding external jars to android projects and ant projects, but I'm not finding out a solution that works in this instance. I'm not too familiar with Ant, which probably exasperates the problem. Problem is: I'm trying to add JSch libraries to my uiautomator project. I put the jsch.jar file into the /libs folder error package com.jcraft.jsch in hopes it would be found by 'android create uitest-project'. However, not the case - so it seems I need to modify build.xml/ant.properties/build.properties or something to get ant to find the jar Specific error is: [javac] Compiling 5 source files to /Users/.../KeyEvents/bin/classes [javac] /Users/.../KeyEvents/src/com/proj/automation/core/coreSSH.java:9: error: package com.jcraft.jsch does not exist The build.xml is created by the android script, and Ant is used out of the box - so I think my scrub-knowledge of ant is the issue :P. android jsch uiautomator share|improve this question asked Apr 15 '13 at 23:33 Brian 182214 Sorry, I was focused on the runtime aspect, so I got rid of my answer (to help encourage other answers). In Eclipse, you'd add it as an external JAR on your build path. If Ant is not picking up libs/... I haven't the foggiest how to fix that. If you get no love here, try the adt-dev Google Group -- this may just be a missing feature on the Ant script side. –CommonsWare Apr 16 '13 at 0:03 @CommonsWare Thanks for the update! You encouraged me to dig into the ant build scripts. While I still don't know what to do exactly, it seems the uite
org.springframework.context.annotation.PropertySource;import org.springframework.jdbc.core.JdbcTemplate;import com.jcraft.jsch.Channel;import com.jcraft.jsch.ChannelExec;import com.jcraft.jsch.JSch;import com.jcraft.jsch.Session;@Configuration@ComponentScan(basePackages = {"com.altimetrik.*"})@PropertySource("classpath:app.properties")public class DataLoad { private JdbcTemplate jdbcTemplate; private String userName; private String host; private String password; private int port; public JdbcTemplate getJdbcTemplate() { return jdbcTemplate; } public void setJdbcTemplate(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } public static void cmremove() { try { String command1="/home/bigdata/test/test.sh"; java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no"); JSch jsch = new JSch(); Session session=jsch.getSession("bigdata", "192.168.115.6", 22); session.setPassword("Aryaa@123"); session.setConfig(config); session.connect(); System.out.println("Connected"); Channel channel=session.openChannel("exec"); ((ChannelExec) channel).setCommand(command1); ((ChannelExec) channel).setErrStream(System.err); channel.connect(); channel.disconnect(); session.disconnect(); } catch(Exception e) { System.err.println("Error: " + e); } } public static void main(String[] args) { cmremove(); }} aW1wb3J0IG9yZy5zcHJpbmdmcmFtZXdvcmsuY29udGV4dC5hbm5vdGF0aW9uLkNvbXBvbmVudFNjYW47CmltcG9ydCBvcmcuc3ByaW5nZnJhbWV3b3JrLmNvbnRleHQuYW5ub3RhdGlvbi5Db25maWd1cmF0aW9uOwppbXBvcnQgb3JnLnNwcmluZ2ZyYW1ld29yay5jb250ZXh0LmFubm90YXRpb24uUHJvcGVydHlTb3VyY2U7CmltcG9ydCBvcmcuc3ByaW5nZnJhbWV3b3JrLmpkYmMuY29yZS5KZGJjVGVtcGxhdGU7CgppbXBvcnQgY29tLmpjcmFmdC5qc2NoLkNoYW5uZWw7CmltcG9ydCBjb20uamNyYWZ0LmpzY2guQ2hhbm5lbEV4ZWM7CmltcG9ydCBjb20uamNyYWZ0LmpzY2guSlNjaDsKaW1wb3J0IGNvbS5qY3JhZnQuanNjaC5TZXNzaW9uOwoKQENvbmZpZ3VyYXRpb24KQENvbXBvbmVudFNjYW4oYmFzZVBhY2thZ2VzID0geyJjb20uYWx0aW1ldHJpay4qIn0pCkBQcm9wZXJ0eVNvdXJjZSgiY2xhc3NwYXRoOmFwcC5wcm9wZXJ0aWVzIi