Matcher throwing IllegalStateException after matches

I'm having some strange issues with Matches, hoping someone could shed some light. According to Java docs: public boolean matches() ... If the match succeeds then more information can be obtained via the start, end, and group methods. Some code: private static Hashtable<String,String> splitAddress(String address){ Hashtable<String,String> result = new Hashtable<S

Matcher在匹配后抛出IllegalStateException

我遇到了一些与Matches有关的奇怪问题,希望有人能够提出一些看法。 根据Java文档: public boolean matches()...如果匹配成功,则可以通过start,end和group方法获取更多信息。 一些代码: private static Hashtable<String,String> splitAddress(String address){ Hashtable<String,String> result = new Hashtable<String,String>(); Matcher m = addrLong.matcher(address);

How to parse JSON in Java

I have the following JSON text. How can I parse it to get pageName , pagePic , post_id , etc.? { "pageInfo": { "pageName": "abc", "pagePic": "http://example.com/content.jpg" } "posts": [ { "post_id": "123456789012_123456789012", "actor_id": "1234567890", "picOfPersonWhoPosted": "http://example.com/photo.jpg",

如何解析Java中的JSON

我有以下JSON文本。 我如何解析它以获取pageName , pagePic , post_id等? { "pageInfo": { "pageName": "abc", "pagePic": "http://example.com/content.jpg" } "posts": [ { "post_id": "123456789012_123456789012", "actor_id": "1234567890", "picOfPersonWhoPosted": "http://example.com/photo.jpg", "nameOfPersonWh

How to add local jar files to a Maven project?

如何直接在我的项目的库源中添加本地jar文件(尚未成为Maven存储库的一部分)? Install the JAR into your local Maven repository as follows: mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging> -DgeneratePom=true Where: <path-to-file> the path to the file to lo

如何将本地jar文件添加到Maven项目?

如何直接在我的项目的库源中添加本地jar文件(尚未成为Maven存储库的一部分)? 按如下方式将JAR安装到本地Maven存储库中: mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging> -DgeneratePom=true Where: <path-to-file> the path to the file to load <group-id&g

Maven: add a dependency to a jar by relative path

I have a proprietary jar that I want to add to my pom as a dependency. But I don't want to add it to a repository. The reason is that I want my usual maven commands such as mvn compile , etc, to work out of the box. (Without demanding from the developers a to add it to some repository by themselves). I want the jar to be in a 3rdparty lib in source control, and link to it by relative pa

Maven:通过相对路径为jar添加一个依赖项

我有一个专有的jar,我想添加到我的pom作为依赖项。 但我不想将其添加到存储库。 原因是我希望我的通常的maven命令,例如mvn compile等,可以开箱即用。 (不要求开发人员a自己将其添加到某个存储库)。 我希望jar在源代码控制的第三方库中,并通过pom.xml文件的相对路径链接到它。 这可以做到吗? 怎么样? 我希望jar在源代码控制的第三方库中,并通过pom.xml文件的相对路径链接到它。 如果你真的想要这样做(理解

Building executable jar with maven?

I am trying to generate an executable jar for a small home project called "logmanager" using maven, just like this: How can I create an executable JAR with dependencies using Maven? I added the snippet shown there to the pom.xml, and ran mvn assembly:assembly. It generates two jar files in logmanager/target: logmanager-0.1.0.jar, and logmanager-0.1.0-jar-with-dependencies.jar. I g

用maven构建可执行jar?

我正在尝试使用maven生成一个名为“logmanager”的小型家庭项目的可执行jar,就像这样: 我怎样才能创建一个可执行的JAR与依赖使用Maven? 我将那里显示的片段添加到pom.xml,然后运行mvn assembly:assembly。 它在logmanager / target中生成两个jar文件:logmanager-0.1.0.jar和logmanager-0.1.0-jar -with-dependencies.jar。 双击第一个jar时出现错误: Could not find the main class: com.gorkwobble.logmanager.LogMa

Including dependencies in a jar with Maven

Is there a way to force maven(2.0.9) to include all the dependencies in a single jar file? I have a project the builds into a single jar file. I want the classes from dependencies to be copied into the jar as well. Update: I know that I cant just include a jar file in a jar file. I'm searching for a way to unpack the jars that are specified as dependencies, and package the class files i

在Maven的jar中包含依赖项

有没有办法强制maven(2.0.9)将所有依赖包括在单个jar文件中? 我有一个项目构建到一个jar文件。 我希望依赖项中的类也可以复制到jar中。 更新:我知道我不能在jar文件中包含一个jar文件。 我正在寻找一种方法来解压指定为依赖项的jar包,并将类文件打包到jar中。 你可以使用带有“jar-with-dependencies”描述符的maven-assembly插件来做到这一点。 下面是我们的一个pom.xml中的相关块: <build> <plugi

Can I add jars to maven 2 build classpath without installing them?

Maven2 is driving me crazy during the experimentation / quick and dirty mock-up phase of development. I have a pom.xml file that defines the dependencies for the web-app framework I want to use, and I can quickly generate starter projects from that file. However, sometimes I want to link to a 3rd party library that doesn't already have a pom.xml file defined, so rather than create the pom.

我可以添加罐子到maven 2生成类路径而不安装它们吗?

在实验/快速和肮脏的模拟开发阶段,Maven2令我疯狂。 我有一个pom.xml文件,它定义了我想要使用的web-app框架的依赖关系,并且可以从该文件快速生成入门项目。 但是,有时我想链接到尚未定义pom.xml文件的第三方库,因此不是手动为第三方库创建pom.xml文件并安装它,并将依赖关系添加到我的pom.xml ,我只想告诉Maven:“除了我定义的依赖关系之外,还包括任何在/lib jar。” 这似乎应该是简单的,但如果是这样,我错过了一些

How do I tell Maven to use the latest version of a dependency?

In Maven, dependencies are usually set up like this: <dependency> <groupId>wonderful-inc</groupId> <artifactId>dream-library</artifactId> <version>1.2.3</version> </dependency> Now, if you are working with libraries that have frequent releases, constantly updating the <version> tag can be somewhat annoying. Is there any way to tell Ma

我如何告诉Maven使用最新版本的依赖关系?

在Maven中,依赖关系通常是这样设置的: <dependency> <groupId>wonderful-inc</groupId> <artifactId>dream-library</artifactId> <version>1.2.3</version> </dependency> 现在,如果您正在处理频繁发布的库,不断更新<version>标签可能会有些恼人。 有什么办法可以告诉Maven始终使用最新的可用版本(来自存储库)? 注意: 这个答案只适用于Maven 2!

Is it possible to build a java project only once using eclipse and share?

is it possible to actually build a maven project containing java code to be built once and the binaries can be shared? Problem: The project i am trying to build would take me about 3-4 hours and requires high internet bandwidth. I am trying to check the possibility of re using this built project among several other machines. I have worked with c++ projects involving makefiles earlier and thi

是否有可能只使用Eclipse和共享建立一个Java项目一次?

是否有可能实际构建一个包含Java代码的Maven项目,并且二进制文件可以共享? 问题:我正在尝试构建的项目需要大约3-4个小时,并且需要很高的互联网带宽。 我正在尝试检查在其他几台机器中重新使用此项目的可能性。 我曾经与涉及makefile的c ++项目合作过,这很简单。 我是Java / eclipse的新手,需要帮助才能确定这是否真的有可能。 PS:我确实试图找到现有的解决方案; 他们没有向前看,或者他们说这是不可能完成的

Java was started but returned exit code=13

I am trying to get my first taste of Android development using Eclipse. I ran into this problem when trying to run Eclipse, having installed version 4.2 only minutes ago. After first trying to start Eclipse without any parameters to specify the Java VM, I got an error message saying it couldn't find a Java VM called javaw.exe inside the Eclipse folder, so I found where Java was installed a

Java已启动,但返回退出代码= 13

我正在尝试使用Eclipse来初次体验Android开发。 试图运行Eclipse时遇到了这个问题,仅在几分钟前安装了4.2版本。 在第一次尝试启动没有任何参数指定Java VM的Eclipse时,我收到一条错误消息,说它无法在Eclipse文件夹中找到名为javaw.exe的Java VM,所以我找到了Java的安装位置并将该位置指定为快捷方式的目标中的参数。 现在我得到一个不同的错误,“Java已启动,但返回退出代码= 13”。 类似的问题似乎表明这是一个32位/ 6