Click here to Skip to main content
15,897,891 members
Home / Discussions / Java
   

Java

 
AnswerRe: Beginner in Java. I want to test my knowledge Pin
JasminHan25-Jun-13 18:43
professionalJasminHan25-Jun-13 18:43 
AnswerRe: Beginner in Java. I want to test my knowledge Pin
MarlBermudoNights3-Jul-13 22:31
professionalMarlBermudoNights3-Jul-13 22:31 
QuestionJava application path in Eclipse juno show wrong neet to set correct Pin
Balmukund Dewangan21-Jun-13 4:21
Balmukund Dewangan21-Jun-13 4:21 
AnswerRe: Java application path in Eclipse juno show wrong neet to set correct Pin
Richard MacCutchan21-Jun-13 5:25
mveRichard MacCutchan21-Jun-13 5:25 
GeneralRe: Java application path in Eclipse juno show wrong neet to set correct Pin
Balmukund Dewangan21-Jun-13 6:32
Balmukund Dewangan21-Jun-13 6:32 
GeneralRe: Java application path in Eclipse juno show wrong neet to set correct Pin
Richard MacCutchan21-Jun-13 6:56
mveRichard MacCutchan21-Jun-13 6:56 
GeneralRe: Java application path in Eclipse juno show wrong neet to set correct Pin
Balmukund Dewangan21-Jun-13 18:11
Balmukund Dewangan21-Jun-13 18:11 
GeneralRe: Java application path in Eclipse juno show wrong neet to set correct Pin
Balmukund Dewangan21-Jun-13 21:17
Balmukund Dewangan21-Jun-13 21:17 
I am using below code and their output in comment (//)
I need this path "E:\SERENE0121201311\phibro" i have code inside this path...

try{
File file = new File(".");
System.out.println("Path 1 : " + file.getCanonicalPath());\
//E:\Eclipse_Juno
System.out.println("Path 2 : " +new java.io.File("").getAbsolutePath());
//E:\Eclipse_Juno
System.out.println("Path 2 : " + file.getCanonicalFile());
//E:\Eclipse_Juno

String path = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
System.out.println("Path 4 : " + this.getClass().getClassLoader().getResource("").getPath());
///E:/SERENE0121201311/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/phibro/WEB-INF/classes/

String s = currentRelativePath.toAbsolutePath().toString();
//E:\Eclipse_Juno
String myCurrentDir = System.getProperty("user.dir")
+ File.separator
+ System.getProperty("sun.java.command")
.substring(0, System.getProperty("sun.java.command").lastIndexOf("."))
.replace(".", File.separator);
System.out.println("Path 5 : " +myCurrentDir);
//E:\Eclipse_Juno\org\apache\catalina\startup

Path currentRelativePath = Paths.get("");
System.out.println("path 6 : "+path);
///E:/SERENE0121201311/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/phibro/WEB-INF/classes/com/crmod/job/impl/XmlRead.class
}catch(Exception e){
e.printStackTrace();
}
GeneralRe: Java application path in Eclipse juno show wrong neet to set correct Pin
Richard MacCutchan21-Jun-13 21:59
mveRichard MacCutchan21-Jun-13 21:59 
GeneralRe: Java application path in Eclipse juno show wrong neet to set correct Pin
Balmukund Dewangan21-Jun-13 22:31
Balmukund Dewangan21-Jun-13 22:31 
GeneralRe: Java application path in Eclipse juno show wrong neet to set correct Pin
Richard MacCutchan22-Jun-13 0:59
mveRichard MacCutchan22-Jun-13 0:59 
QuestionWebservice in Java Pin
Ganeshbabu.R21-Jun-13 2:27
professionalGaneshbabu.R21-Jun-13 2:27 
AnswerRe: Webservice in Java Pin
NotPolitcallyCorrect21-Jun-13 2:36
NotPolitcallyCorrect21-Jun-13 2:36 
GeneralRe: Webservice in Java Pin
Ganeshbabu.R21-Jun-13 2:49
professionalGaneshbabu.R21-Jun-13 2:49 
GeneralRe: Webservice in Java Pin
Sudhakar Shinde2-Jul-13 23:40
Sudhakar Shinde2-Jul-13 23:40 
QuestionConverting Wav file to MP3 or other format Pin
manojnovpandey21-Jun-13 2:25
manojnovpandey21-Jun-13 2:25 
AnswerRe: Converting Wav file to MP3 or other format Pin
NotPolitcallyCorrect21-Jun-13 2:37
NotPolitcallyCorrect21-Jun-13 2:37 
QuestionPlease help me to solve “fix control's position in GridBagLayout” Pin
Bee cute21-Jun-13 1:40
Bee cute21-Jun-13 1:40 
Questionrecent file list Pin
Member 1009379520-Jun-13 23:45
Member 1009379520-Jun-13 23:45 
AnswerRe: recent file list Pin
Richard MacCutchan21-Jun-13 2:21
mveRichard MacCutchan21-Jun-13 2:21 
QuestionHow to displayed a yield in jtable? Pin
tolulan20-Jun-13 5:00
tolulan20-Jun-13 5:00 
AnswerRe: How to displayed a yield in jtable? Pin
Richard MacCutchan20-Jun-13 7:02
mveRichard MacCutchan20-Jun-13 7:02 
QuestionInsert blob from android to oracle Pin
Raditya Kurnianto16-Jun-13 19:36
Raditya Kurnianto16-Jun-13 19:36 
AnswerRe: Insert blob from android to oracle Pin
jschell17-Jun-13 8:12
jschell17-Jun-13 8:12 
AnswerRe: Insert blob from android to oracle Pin
Richard MacCutchan17-Jun-13 21:18
mveRichard MacCutchan17-Jun-13 21:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.