String path;
public void main(String[] args) {
File file=new File("");
path=file.getAbsolutePath();

syso(path);

结果:

D:\svnout\borncrm-biz

获取项目根目录(非tomact)的更多相关文章

  1. Java中动态获取项目根目录的绝对路径

    https://www.cnblogs.com/zhouqing/archive/2012/11/10/2757774.html 序言 在开发过程中经常会用到读写文件,其中就必然涉及路径问题.使用固定 ...

  2. java 获取项目根目录

    代码入下: request.getSession().getServletContext().getRealPath(); 这里的getRealPath()括号里面可以输入你想得到的具体目录. 需要注 ...

  3. Weblogic部署web项目获取项目根目录为null

    写在前面 图片上传功能, web项目部署在本地Tomcat上并没有问题, 但是打成war包部署到Linux服务器Weblogic下却出现如题问题, 导致图片上传失败. 问题代码 String real ...

  4. Java获取项目根目录等其他系统属性

    一 相对路径的获得 说明:相对路径(即不写明时候到底相对谁)均可通过以下方式获得(不论是一般的java项目还是web项目) String relativelyPath=System.getProper ...

  5. c# 获取项目根目录方法

    编写程序的时候,经常需要用的项目根目录.自己总结如下 1.取得控制台应用程序的根目录方法     方法1.Environment.CurrentDirectory 取得或设置当前工作目录的完整限定路径 ...

  6. .net获取项目根目录方法集合

    这篇文章是别的博客复下来,收藏的: 编写程序的时候,经常需要用的项目根目录.自己总结如下 1.取得控制台应用程序的根目录方法     方法1.Environment.CurrentDirectory ...

  7. js获取项目根目录的方法

    getRootPath = function(){ //获取当前网址,如: http://localhost:8080/ems/Pages/Basic/Person.jsp var curWwwPat ...

  8. JS获取项目根目录

    function getRootPath(){ //获取当前网址,如: http://localhost:8088/test/test.jsp var curPath=window.document. ...

  9. SpringMVC中Freemarker获取项目根目录

    https://blog.csdn.net/whatlookingfor/article/details/51538995 在SpringMVC框架中使用Freemarker试图时,要获取根路径的方式 ...

随机推荐

  1. luoguP1540 机器翻译 题解(NOIP2010)

    P1540 机器翻译  题目 #include<iostream> #include<cstdlib> #include<cstdio> #include<c ...

  2. min-element & max_element

    C++ STL之min_element()与max_element()(取容器中的最大最小值) min_element()和max_element 头文件:#include<algorithm& ...

  3. 50.Maximal Square(最大正方形)

    Level   Medium 题目描述: Given a 2D binary matrix filled with 0's and 1's, find the largest square conta ...

  4. Vue小白篇 - Vue 的指令系统 (1) v-text、v-html

    v-text:相当于innerText v-html:相当于innerHTML <div id="box"> {{ msg }} <div v-text=&quo ...

  5. Web前端基础学习-3

    bfc(block formatting context) 块级格式化上下文 生成bfc的方式: 1.根元素: 2.float属性不为none(脱离文档流): 3.position为absolute或 ...

  6. kvm的img文件的本机挂载

    非lvm分区挂载方法: mount -o loop xxx.img /mnt/xxx 系统提示: “mount: you must specify the filesystem type” 执行:fd ...

  7. 全栈开发React-私有路由

    demo import React from 'react'; import {Route,Redirect} from 'react-router-dom' import {connect} fro ...

  8. 10.ThreadLocal

    /** * - void set(Object value)设置当前线程的线程局部变量的值. * - public Object get()该方法返回当前线程所对应的线程局部变量. * - publi ...

  9. postgres服务相关语法

    远程登陆 psql -h 主机 -U 用户 -p端口 -W -d 数据库 #-W表示密码,例如:psql -h 192.168.137.3 -U postgres -p 5432 -W -d post ...

  10. 【leetcode】948. Bag of Tokens

    题目如下: You have an initial power P, an initial score of 0 points, and a bag of tokens. Each token can ...