使用IDEA的时候有时要用到eclipse的user library,由于两个IDE导入library的方式不同导致我们找不到导入user library的方法。
查IDEA的官方文档,找到方法如下:
首先要导入user library :
 
 
Eclipse IDEA
Workspace Project
Project Module
Project-specific JRE Module JDK
User library Global library
Classpath variable Path variable
Project dependency Module dependency
Library Module library
那么我们在IDEA下要导入的就是Global library。
导入后加到module中,libray有个选项叫做Scope ,有如下值Compile  Test  Runtime Provided

                        Scope Use this drop-down to affect the classpath for the various build phases.

  • Compile: This is the default option. If it is selected, the dependency is resolved and is available in classpath during the compilation and run phases.
  • Test: Select this option, if this dependency is only required for tests, and should not be available in normal application use. If this scope is selected, the dependency is resolved and is available in classpath during the test compilation and run phases.
  • Runtime: This scope indicates that the dependency is only required when running the application, and should not be available in classpath during the compilation.
  • Provided: If this option is selected, the dependency is resolved and is available in classpath during the compilation, but is not included in classpath at runtime. This dependency scope is useful, when you have some container that provides the dependency at runtime.
由于我们要加入的是动态加载的库,所以要求编译的时候不加载,只有在运行用到的时候调用。
所以Scope选择Provided选项。
默认是Compile,编译的时候会随module进行编译,此处要改为Provided
 
搞定。
原文地址:http://blog.csdn.net/hlglinglong/article/details/29808575
 
现在有个需求是这样。module A要用到user library,module A 使用上述方法将user library 导入,并将order 放置在Andorid SDK的上面。
module B要Dependency A
在mudule B中把A作为依赖库导入,Scope选择Provided ,出现如下错误
 java.lang.VerifyError
 
是因为库的导入方式不对,
mudule B中把A作为依赖库导入,Scope选择Compile 。搞定

intellij idea 添加动态 user library(java.lang.VerifyError)【转】的更多相关文章

  1. Android项目更换开发环境时出现的 java.lang.VerifyError 异常解决办法

    from://http://blog.csdn.net/wudiwo/article/details/7548451 项目是从同事的电脑上直接拷贝过来的,项目里面的jar包是在项目跟下libs里面存放 ...

  2. java.lang.VerifyError

    public class VerifyErrorextends LinkageError Thrown when the "verifier" detects that a cla ...

  3. Android ADT插件更新后程序运行时抛出java.lang.VerifyError异常解决办法

    当我把Eclipse中的 Android ADT插件从21.1.0更新到22.0.1之后,安装后运行程序抛出java.lang.VerifyError异常. 经过调查,终于找到了一个有效的解决办法: ...

  4. hadoop+javaWeb的开发中遇到包冲突问题(java.lang.VerifyError)

    1.HDFS + WEB 项目 报java.lang.VerifyError... 异常 抛异常: Exception in thread "main" java.lang.Ver ...

  5. jedis:exception is java.lang.VerifyError: Bad type on operand stack

    项目中需要用到缓存,经过比较后,选择了redis,客户端使用jedis连接,也使用到了spring提供的spring-data-redis.配置正确后启动tomcat,发现如下异常: ======== ...

  6. java.lang.VerifyError异常

    以前遇到过java.lang.VerifyError 原因是jar包冲突 tomcat6自带jsp.jar.servlet.jar所以项目中不用引入 tomcat5不带jsp.jar.servlet. ...

  7. 9、android开发之java.lang.verifyError(转载)

    原文链接: http://www.linuxidc.com/Linux/2012-08/67289.htm 解决方案: 最近在做一个Android开发小项目的时候,遇到java.lang.verify ...

  8. j疑难杂症:java.lang.VerifyError: class org.hibernate.type.WrappedMaterializedBlobType overrides final method getReturnedClass.()Ljava/lang/Class;

    问题: java.lang.VerifyError: class org.hibernate.type.WrappedMaterializedBlobType overrides final meth ...

  9. Scala 安装 Exception in thread "main" java.lang.VerifyError: Uninitialized object exists on backward branch 96

    windows下载安装完最新版本的Scala(2.12.4)后,终端如下错误 C:\Users\Administrator>scala -versionException in thread & ...

随机推荐

  1. 解决navicate 连接mysql数据库中文乱码的问题

    以下均是ubuntu12.04为准 1.修改mysql的配置文件. 1.1.vi  /etc/mysql/my.conf找到[client]在其下面添加 default-character-set=u ...

  2. 使用Advanced Installer进行二次打包

    使用Advanced Installer进行二次打包 在上一篇使用InstallerShield打包VS程序中,我已经叙述过,为什么要进行二次打包的问题,在此我就不再赘述.本次长枪直入,说一说如何使用 ...

  3. hystrix应用介绍(四)

    前几章已经讲了hystrix的应用场景,以及如何使用,本章我们针对如何进行hystrix参数配置做一些分析 //异步的执行 @HystrixCommand(groupKey = "testK ...

  4. kafka brokers配置参数详解

    基本配置如下: -broker.id-log.dirs-zookeeper.connect Topic-level配置以及其默认值将在下面讨论. Property Default Descriptio ...

  5. Python基本操作之文件操作

    一. 1.文件操作的函数 open("文件名字(路径)",mode="模式",encoding="字符集") 2.模式:r,w,a,r+,w ...

  6. BZOJ1563: [NOI2009]诗人小G(决策单调性 前缀和 dp)

    题意 题目链接 Sol 很显然的一个dp方程 \(f_i = min(f_j + (sum_i - sum_j - 1 - L)^P)\) 其中\(sum_i = \sum_{j = 1}^i len ...

  7. [RabbitMQ]Windows环境下rabbitmqclt(Command Line Tools)出现Erlang distribution failed错误的解决方法

    摘要 当使用rabbitmqctl时出现Erlang distribution failed,把%SystemRoot%Windows\System32\config\systemprofile下的. ...

  8. 增加ssh无密码信任连接的安全性

    为了方便系统管理或者服务器运维自动化,我们通常要在服务器间做ssh无密码信任连接. 环境:目标主机    centos7    192.168.150.110操作主机    centos7-cn 19 ...

  9. Debug get/set property

    1. Select "Debug -> Windows -> Breakpoints" from VS menu. 2. Click "New -> B ...

  10. Azure进阶攻略丨如何驾驭罢工的Linux虚机网卡?

    很多人的生活中,流传着一个屡试不爽,据说可以解决任何问题的百宝锦囊: 所以经常可以听到类似这样的对话: -我的电脑咋上不去网了? -重启一下电脑. -还是不行呢! -重启一下路由器. -怎么还不行-_ ...