classpath

maven add a local classes directory to module's classpath

佐手、 提交于 2019-12-01 01:01:43
I know this is a bit out of maven's scope, but I need to add a local directory with compiled classes to the module's classpath. I saw: Maven: add a folder or jar file into current classpath , but this is good for a jar only. I need to have a similar solution but with compiled classes in a directory on local file system. Is this even possible? Thx! After some extensive research, I found that my best option was to use the maven-antrun-plugin and during the process-resources phase, generate a jar from the classes and add it as dependency with system scope and systemPath to the jar I just built.

Could not find or load main class when calling Weka

≯℡__Kan透↙ 提交于 2019-12-01 00:49:37
I apologise for my Java noobness but I am trying to use Weka from console and for some reason I get following error: Error: Could not find or load main class weka.classifiers.trees.J48 I am trying following command: java weka.classifiers.trees.J48 -l C:\xampp\htdocs\frequencyreplyallwords.arff -T C:\xampp\htdocs\testfreqrep.arff -p 0 > C:\xampp\htdocs\output.txt I suspect some problems with classpath but since I don't really understand Java is there any simple way of checking if everything is correct? Thank you for any help Linux/macOS solution download a relevant version such as the Developer

bootstrap class path not set in conjunction with -source 1.6

纵然是瞬间 提交于 2019-12-01 00:38:57
问题 I am upgrading my application from java 1.6 to 1.7. When I try to build using Maven 3.2.1, my build fails with below error msg: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project my-app5: Compilation failure: Compilation failure: [ERROR] could not parse error message: warning: [options] bootstrap class path not set in conjunction with -source 1.6 I am using java 1.7 hotspot and previously I was using 1.6 jrockit. My

How to handle with CLASSPATH in Maven project?

对着背影说爱祢 提交于 2019-11-30 23:34:59
I am trying simple Maven app with Log4J ver 2-beta 9. In my pom.xml file I have these two dependencies (as is mentioned in Log4J Maven webpage ): <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.0-beta9</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.0-beta9</version> </dependency> Eclipse sees Log4J library: But when I package the app and run it this Exception is thrown: java -cp target/notification-1.0.0.jar com.example.Sandbox Exception in thread "main" java

How to configure the order of libraries in the classpath for Android Studio?

▼魔方 西西 提交于 2019-11-30 22:06:24
问题 I would like to change the order of libraries in the classpath for Android Studio. I am trying to run unit tests with JUnit 4 from within the IDE . This works following the instruction in these slides. I wonder if it is possible to configure the order of the libraries - other then suggested in the slides - via the Run Configuration of Android Studio? The first attempt was to change the order of dependencies in the Project Structure dialog in the Dependency tab of the project module as show in

How can I permanently add a class path to my Mac terminal?

坚强是说给别人听的谎言 提交于 2019-11-30 21:29:27
I want to set my path permanently for the following directory: /Users/syalam/Library/android-sdk-mac_86/platform-tools Not sure how to do it from the terminal. I tried: export PATH=$PATH:/Users/syalam/Library/android-sdk-mac_86/platform-tools but it only works temporarily. After I close my shell it no longer exists. Just add this entry to your CLASSPATH environment variable in your .bashrc : export CLASSPATH="/Users/syalam/Library/android-sdk-mac_86/platform-tools:$CLASSPATH" http://blog.just2us.com/2011/05/setting-path-variable-in-mac-permanently/ Set permanently for a user: Edit the user’s

read excel file(which is in classpath ) via apache poi

我与影子孤独终老i 提交于 2019-11-30 20:45:01
I am trying to read (using apache poi) .xlsx file which is not in file system but in classpath. I am using maven - so it is in resources folder. my code is - InputStream resourceAsStream = MyReader.class.getClassLoader().getResourceAsStream("test.xlsx"); Workbook wb = new XSSFWorkbook(resourceAsStream); I am getting this exception. Caused by: java.lang.IllegalArgumentException: MALFORMED at java.util.zip.ZipCoder.toString(ZipCoder.java:58) ~[?:1.7.0_51] at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:297) ~[?:1.7.0_51] at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream

System.getProperty(“java.class.path”) does not show “WEB-INF/lib” and the including jars

拜拜、爱过 提交于 2019-11-30 20:32:10
问题 String CompilePath = "abc.java"; JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); String classpath = System.getProperty("java.class.path"); System.setProperty("java.class.path", classpath + ";" + LocalMachine.home + "WebContent/WEB-INF/lib"); int result = compiler.run(null, null, null, CompilePath); The above runs fine when executed as a JUnit test since all the jars required for compiling the abc.java file. But when the same code is being run in as server, it fails to find the

How to include hbase-site.xml in the classpath

杀马特。学长 韩版系。学妹 提交于 2019-11-30 20:28:27
I am currently trying to get my HBase code to use the settings specified in my hbase-site.xml. It seems to use default settings instead of what is specified in the hbase-site.xml config file. I have restarted the HBase cluster since updating the files, but it is still not using config files that I updated. The cluster I am using is 2 nodes, one of which is the master. The config files on both of the nodes specify the IP of the master node as the zookeeper quorum. I believe the problem is that my settings specified in hbase-site.xml are not being used because the code runs fine if I set the

why I am getting Class not found exception

此生再无相见时 提交于 2019-11-30 20:20:15
问题 I am using DeferredTextImpl Class and eclipse does not seems to complain about it but when I run my project I get run time exception .... Class not found exception for DeferredTextImpl .. When I searched for the class file, I found it in rt.jar which should certainly be on the class path. I also checked the build path in project properties->Java build path and could see JRE System Library at the very bottom. when I expanded that. I could see rt.jar . which means it is on the class path, right