草庐IT

working-directory

全部标签

java - 在 IntelliJ IDEA 中设置 JDK 10 : the selected directory is not a valid home for JDK

有人试过在MacOS的IntelliJ上设置JDK10吗?尝试这样做时,我收到的消息是“所选目录不是JDK的有效主目录”。我已经安装了oracle为MacOS提供的JDK10我机器上的JDK安装路径是/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home 最佳答案 正确支持Java10需要IntelliJIDEA2018.x版本。IntelliJIDEA2017.x版本可能无法正确检测Java安装路径。 关于java-

java - 为什么 p :panelGrid not work with ui:repeat?

如果我按如下方式使用,则不会出现错误,也不会输出。为什么p:panelGrid不能与ui:repeat一起使用?注意:我不想使用c:forEach因为我已经面临很多JSF问题。MyBean.javapublicListgetDataList(){Listresult=newArrayList();result.add(newData("Name1","Description1"));result.add(newData("Name2","Description2"));result.add(newData("Name3","Description3"));result.add(newD

java - Jar 文件 ADD DIRECTORY ENTRIES 导出 jar 时的 Eclipse 选项

我不知道我是否在问正确的问题,但想消除我的疑问。其实我遇到过从jar文件引用类文件的场景。我的意思是说我有一个后端java项目,比如ABC,里面有application-context.xml文件。现在我创建了ABC项目的jar文件并在一个基于Web的应用程序中使用。在这里,我遇到了bean没有Autowiring的问题,后来才知道问题是,我用Eclipse导出ABC项目的jar文件时,没有选择“ADDDIRECTORYENTRIES”复选框,后来我做了并且全部工作。只是为了查看通过在jar文件中选中此框进行了哪些更改,以便一切正常,所以我创建了2个jar文件,一个选中了“ADDDIR

java - Primefaces 用户界面 :repeat not working

我正在尝试在Primefaces中创建accordionPanel。我正在尝试使用ui:repeat创建它,这样我就可以动态创建面板选项卡。但不知何故我的代码不起作用,accordionPanel是空的,没有任何标签。任何人都可以给我原因或指出如何实现这一目标。这是我的bean。@ManagedBean(name="divisionList")publicclassDivisionsimplementsSerializable{privateListdivStrings;publicListgetDivStrings(){returndivStrings;}publicDivision

java - 单元测试 : assert not work?

我刚刚应用了一段时间的UnitTest,今天我遇到了一些很奇怪的事情。考虑以下代码:TestObjectalo=null;assertalo!=null;//Pass!!!Assert.assertNotNull(alo);//Fail,asexpected.我四处搜索,发现assert是java内置的,而assertNotNull是JUnit支持的。但是我不明白为什么assert不提示空对象? 最佳答案 Hoang,我认为您对Java语言断言和JUnit断言有点混淆。Java中的assert关键字是在1.4中添加的,旨在允许验证类

java - Spring Data JPA 存储库 : IN-clause in derived query not working

我有一个看起来像这样的存储库:publicinterfaceUserRepositoryextendsJpaRepository{UserfindByEmailIgnoreCase(Stringemail);@Query("selectufromUseruwhereu.idin(:ids)")SetgetByIdInSet(@Param("ids")Setids);}当我调用getByIdInSet时,出现以下错误:Causedby:java.lang.IllegalArgumentException:Youhaveattemptedtosetavalueoftypeclassorg.

Java Apache FTPClient : How to know my current directory

我的问题很简单:我在连接到FTP的简单应用程序中使用Apachecommons.netAPI,我可以使用changeWorkingDirectory方法更改工作目录。但是...我怎么知道我的当前目录而不更改它? 最佳答案 printWorkingDirectory()返回当前工作目录的路径名。Here'sthereference. 关于JavaApacheFTPClient:Howtoknowmycurrentdirectory,我们在StackOverflow上找到一个类似的问题:

java - GWT : how to get regex(Pattern and Matcher) working in client side

我们使用GWT2.03和SmartGWT2.2。我正在尝试在客户端代码中匹配如下所示的正则表达式。Patternpattern=Pattern.compile("\\\"(/\d+){4}\\\"");StringtestString1="[\"/2/4/5/6/8\",\"/2/4/5/6\"]";StringtestString2="[]";Matchermatcher=pattern.matcher(testString1);booleanresult=false;while(matcher.find()){System.out.println(matcher.group());

java - 打包时如何使maven "add directory entries"?

我有一个程序利用getClass().getClassLoader().getResource()获取目录的URL,它在eclipse中工作正常,但在jared之后,它返回空。根据这个网址:http://www.coderanch.com/t/385935/java/java/getResource-path-fails-JarTheproblemresultedbecausethepathitselfdidnotexistinthejar.Thefileswiththepathexisted,butnotthepathitself.Iwasusingthe"RunnableJARFi

java - Spring 数据休息 : RepositoryRestController deserialization from URI not working

我的问题是从URI字符串反序列化实体。当我使用由SpringDataRest生成的HTTP接口(interface)时,一切正常。我可以针对我的端点/api/shoppingLists发布以下JSON,它将被反序列化为以管理员为所有者的购物list。{"name":"Test","owners":["http://localhost:8080/api/sLUsers/admin"]当我使用自定义RepositoryRestController时,这不再起作用。如果我将完全相同的JSON发布到相同的端点,我会收到此响应。{"timestamp":"2015-11-15T13:18:34.