If the current directory of the application. If e.g. you create a File by using

new FileOutputStream("myfile")

then it is created in the "current" directory, which can be retrieved by calling

System.getProperty("user.dir");

However if you change the current directory by calling native methods (very unlikely!), the property is not updated. It can be seen as the initial current directory of the application.

If you start your Java app in a batch file, and doubleclick on the link to it, the current directory will be the directory where the batch file resided, but this can be changed in the link.

If you start your Java app from the command line, you already know the directory you are in.

If you start your Java app from the IDE, the current directory is usually the project root, but this can usually be configured in the launch configuration.

In Java, what is the default location for newly created files?的更多相关文章

  1. selenium python 报错“ unable to find binary in default location”

    selenium python 报错如下: raise exception_class(message, screen, stacktrace)selenium.common.exceptions.W ...

  2. JAVA 8 默认方法-Default Methods

    什么是默认方法-Default Methods 简单的说,就是可以在接口中定义一个已实现方法,且该接口的实现类不需要实现该方法: 如下示例: interface GreetingService { v ...

  3. Java 8新特性——default方法(defender方法)介绍

    我们都知道在Java语言的接口中只能定义方法名,而不能包含方法的具体实现代码.接口中定义的方法必须在接口的非抽象子类中实现.下面就是关于接口的一个例子: 1 2 3 4 5 6 7 8 9 10 11 ...

  4. 解决 java Could not resolve resource location pattern [classpath:sql/*.xml] 的问题

    时间过的真快,转眼间已经有2年了.2年里发生了太多的事,有些事依稀还记得,但更多的已经忘记.忘记了那些烦恼与忧愁,以为自己会快乐,才发现一切并不是以自己的意志为转移.终于在迷途中迷失了自己, 再也回不 ...

  5. Java NIO学习(Path接口、Paths和Files工具类的使用)

    NIO学习:Paths和Files工具类的使用 JDK1.7引入了新的IO操作类.在java.nio.file包下,Java NIO Path接口和Files类. Path接口:Path表示的是一个目 ...

  6. Java基础教程——File类、Paths类、Files类

    File类 File类在java.io包中.io代表input和output,输入和输出. 代表与平台无关的文件和目录. 可以新建.删除.重命名,但不能访问文件内容. File类里的常量: impor ...

  7. JAVA 报错exe4j中this executable was created with an evaluation 怎么办

    如果使用未破解注册的exe4j打包JAR文件为EXE,运行EXE的时候就会出现下面的提示   打开exe4j软件,Change License或者是输入序列号,然后用注册机算一个注册码即可  

  8. 不用find,怎样递归地给目录设置700,给文件设置600权限?

    https://stackoverflow.com/questions/36553701/how-to-set-permissions-recursively-700-for-folders-and- ...

  9. Java系列--目录

    因工作项目的需要,从C#转Java也有很长一段时间了,决定记载归纳一下这半年到底学了什么,到了一个什么程度,当然其间可能会有一些关于.NET的对比. 这是这个系列的目录,我准备按照我的归纳学习点来写, ...

随机推荐

  1. linux磁盘以及文件系统

    df 查看磁盘总容量 -i 显示inodes号 -h 使用合适的单位显示磁盘大小 -m 以M为单位显示 -k 以K为单位显示 默认K显示 du 用来查看某个目录或者文件所占空间大小 参数:-abckm ...

  2. wap开发之滑动事件(swipe、tap、swipeleft、swiperight)等

    最近一直找在wap端可以实现的swipe等滑动事件的方法,开始研究了jquery-mobile,zepto,结果由于jqm太大.zepto有不少缺陷.为此研究了zepto,想把里面的swipe事件独立 ...

  3. IOS 多线程之GCD

    参考:http://www.cnblogs.com/wendingding/p/3806821.html <<Objective-C基础教程>> 第二版 一 简介 GCD 全称 ...

  4. linq 动态排序

    /// <summary> /// 排序 /// </summary> /// <typeparam name="T"></typepar ...

  5. App评分

    //应用实现评论跳转的两种方法: //第一种: //在iOS6.0前跳转到AppStore评分一般是直接跳转到AppStore评分 //NSString *evaluateString = [NSSt ...

  6. 【2011 Greater New York Regional 】Problem I :The Golden Ceiling

    一道比较简单但是繁琐的三维计算几何,找错误找的我好心酸,没想到就把一个变量给写错了 = =: 题目的意思是求平面切长方体的截面面积+正方体顶部所遮盖的面积: 找出所有的切点,然后二维凸包一下直接算面积 ...

  7. 【codeforce 219D】 Choosing Capital for Treeland (树形DP)

    Choosing Capital for Treeland Description The country Treeland consists of n cities, some pairs of t ...

  8. 心愿:做一个精简版MFC

    我觉得自己有能力看懂MFC的C++代码和总体流程,但是由于MFC混杂了太多的东西,比如OLE等等不必要的东西,又做了无数的ASSERT判断,影响整体流程的理解.因此我要做一个精简版的MFC,而且能用它 ...

  9. 带文字的ImageButton[自定义]

    今天Android项目中遇到一个ImageButton控件上面要显示文字,无奈自定义了一个ImageButton,继承自ImageButton.其实就是override这个控件的onDraw(Canv ...

  10. 【2015年最新App Store退款流程详解】最详细AppStore退款流程图文教程

    本帖最后由 想吐就吐出来 于 2015-7-1 14:25 编辑 如果你一不小心买错了iOS软件,从App Store上下载了游戏或软件后悔了,那怎么办?可以退款吗?答案是可以的!苹果这点还是很人性化 ...