Unable To Find JDK Path
Sep 19, 2013
I am new to linux and using centos ver 6.4 64bit . i want to install sqldeveloper so i run below rpms
sqldeveloper-3.2.20.09.87-1.noarch.rpm
jdk-7u40-linux-x64.rpm
After install when i run sqldeveloper command then it prompt me for jdk path
1. Which I don't know how to find
2. When I try to give /usr/bin/java1.7.0_09/ and enter then it give me below error
/usr/bin/java1.7.0_09
Error: /usr/bin/java1.7.0_09/bin/java not found
Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will be stored in ~/.sqldeveloper/jdk
View Replies
ADVERTISEMENT
May 17, 2013
I ma trying to implement Java "watchService". I am unable to register network mounted drive path. Is there any solution for this.
Path ftpFolder = Paths.get("H:/Ftp/Incoming/");
where H is mounted Drive.
View Replies
View Related
Jan 30, 2014
I am trying to connect a remote machine but I can't. There is a shared folder in the remote machine, when I write the path to file browser in local machine, it does not find the path specified. Both machines have successful network condition and ping each other. Also, the shared folder is opened to everyone, there should not be a permission problem, right?
View Replies
View Related
Feb 25, 2015
I have the Java Development Kit downloaded in my C file and my book tells me to compile the program I need to open command windowand change the directory where the program is stored. I tried the command cd to change directory and received this message "The system cannot find the path specified."
I checked the Environment Variables on Windows 7 and the Path says: C:Program Files (x86)Javajre1.8.0_31in
This is after many tries and i still can't change directory and i keep getting the same message.
View Replies
View Related
Feb 24, 2015
I have the Java Development Kit downloaded in my C file and my book tells me to compile the program I need to open command windowand change the directory where the program is stored. I tried the command cd to change directory and received this message "The system cannot find the path specified." I checked the Environment Variables on Windows 7 and the Path says: C:Program Files (x86)Javajre1.8.0_31in
This is after many tries and i still can't change directory and i keep getting the same message.The book I am using to learn Java is "Java How to Program: Tenth Edition" from Paul and Harvey Deitel.
View Replies
View Related
Jun 30, 2014
I have a code that uploads files in server after browsing folders and files then get the paths of files but I have a problem in getting the paths
List items = upload.parseRequest(request);
Iterator iterator = items.iterator();
while (iterator.hasNext()) {
FileItem item = (FileItem) iterator.next();
if (!item.isFormField())
{ fileName = item.getName();
root = getServletContext().getRealPath("/");
path = new File(root + "/uploads");
[Code]...
list1 must has paths that I want but I do not get the paths of upload files
View Replies
View Related
Feb 18, 2015
I have some N*M matrix or N*N matrx , and there's a "worm" that can start from any index in the first column, or, any index in the first row. i need to choose the longest worm that satisfying this :
The index that comes after the index before him must be greater then 1. and i must use recursion, also for helper methods. no loops at all. that's it. i'm having a problem to find the longest worm in the matrix.
My idea was to create an helper array and assign to the array indexes a variable that will count the steps of the worm and finally assigns in to the helper array index. then i used findMax method to find the max value in an index. and thats will be the longest worm. i wrote a lot of code so i wont put it here. i will say that i'm close. if the longest worm is 6 i get in my output 7.
View Replies
View Related
Jun 24, 2014
First of all, i am using ubuntu and jdk8. My problem: displaying the current path of a file in my system Approach: I have a file called dummy.txt in a given directory which have enough permissions and i did the following:
File file=new File("dummy.txt");
System.out.println(file.getAbsolutePath().substring(0,file.getAbsolutePath().lastIndexOf("/")));
I expected to see displayed the current path of the file without the name of the file but it is showing a different path. I just want to display the current path of the file without the name.
View Replies
View Related
Feb 13, 2015
i want to build a simple x,y grid in eclipse. Where an simple agent can search for a goal and end the episode.
I have java experience but I cant get my head around something simple as this.
I know there will be state, actions and environment and agent class.
But I cannt figure out where to start with this, do i start with state or action.
View Replies
View Related
May 25, 2015
Trying to find cheapest path recursively, given a grid a integers trying to recursively find the cheapest path from the top to the bottom. cheapest being the sum of the path. I think I've made my code over complicated. recursive things are usually much more elegant
import java.io.FileInputStream;
import java.util.Scanner;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class trial {
public void readFile(String fileName)
[Code] ....
and here is the grid
27 19 18 85 32 11 18 24 22 98
60 83 52 61 18 64 74 33 95 42
56 27 71 56 65 70 18 78 35 74
15 89 19 92 61 76 92 42 57 26
88 28 78 45 21 98 11 72 82 97
49 54 88 79 16 43 27 78 52 71
17 18 60 40 72 39 70 52 96 11
62 79 25 50 73 40 98 64 44 72
25 79 72 25 64 35 29 16 77 96
12 93 49 64 61 34 83 87 34 36
View Replies
View Related
Mar 4, 2015
So what I'm trying to do is write a code in java which finds a path through a maze. I want it to go through the maze and determine if there's a * symbol at that location or not. If there is a * symbol at the specified location then the program would search for another position until it finds one without the * symbol and if it can't then I'll have the program return null. I also want it to implement backtracking which I'm not sure how to do. Here's my code so far
private boolean findPath(int fromRow, int fromCol, int toRow, int toCol){
boolean solved = true;
for(int i=fromRow; i<toRow; i++){
for(int j=fromCol; j<toCol; j++){
if (x[i][j] == ('*')){
//do something
}
}
}
return false;
}
the code isn't finished yet however what I'm not sure is what do I do with the if statement and how do I implement backtracking?
View Replies
View Related
Aug 12, 2014
If you aren't familiar with the euler problem 67, you are given an array that is a set of numbers in a triangle. Like this
3
7 4
2 4 6
8 5 9 3
and you have to find the maximum path, which for this one is
(3)
(7) 4
2 (4) 6
8 5 (9) 3
I have solved this problem iteratively with the code below
depth = depth-2;
while (depth >=0) {
for (int j = 0; j <= depth; j++) {
values[depth][j] += Math.max(values[depth+1][j], values[depth+1][j+1]);
}
depth -= 1;
}
depth is a variable for the row in the triangle. My problem is that i need the solution to be recursive and i am having trouble doing this. So far i have
public static int findMax(int[][] array,int depth) {
if (depth==0)
return array[0][0];
else if
}
View Replies
View Related
Feb 7, 2014
I am running this method but for some reason I am not able to find the data record, it keeps going to the catch. I have the data.txt file in the same directory as the java file.
public static Games[] gamesRecord(){
Games[] game = new Games[50];
try{
Scanner dataFile = new Scanner(new File("data.txt"));
for(int i = 0; i > 50; i++){
game[i].title = dataFile.next();
game[i].releaseDate = dataFile.nextInt();
game[i].redistributions = dataFile.nextInt();
game[i].platformRelease = dataFile.next();
[code]....
View Replies
View Related
Nov 6, 2014
I get this message in eclispe: Cannot find tag library descriptor for 'http://java.sun.com/jsp/jstl/core"'
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
In another thread I saw the suggestion that including jstl.jar in classpath would resolve this issue.It tried that but the issue still exists.
View Replies
View Related
Jan 21, 2015
While usiing JSF f:ajax tag, I am getting the following error for not being able to load jsf.js file.
Looking for resolving this error?
JSF1064: Unable to find or serve resource, jsf.js.xhtml
View Replies
View Related
Oct 10, 2014
I want to find the prime palindrome numbers less that a given number by my program. Here is my code, I am trying to find the method to solve the errors when I compile it. It said variable a might not have been initialized in line 41,62,86.
import java.util.Scanner;
public class Lab5{
public static void main (String[] args){
System.out.println("Please input a number");
Scanner Input=new Scanner(System.in);
int num = Input.nextInt();
[Code]...
View Replies
View Related
Nov 7, 2014
I am copying the xml files from one folder to other folder, in the source folder, i have some files which have some content like "backing File="$IDP_ ROOT/metadata/iPAU-SP-metadata.xml" but while writing to the destination folder.i am replacing the "$IDP_ROOT" with my current working directory. The entire copying of files is for deploying into tomcat server. The copying is done only when server starts for the first time.Problem: If i change the folder name from my root path in my machine after i run the server,the entire process will be stopped because the destination folder files already contains the content which is with existed files names or folder names.
So i want to change it to relative path instead absolute path. What is the best way to do it? Please look at code below:
[ // Getting the current working directory
String currentdir = new File(".").getAbsoluteFile().getParent() + File.separator;
if(currentdir.indexOf("ControlPanel")!=-1){
rootPath=currentdir.substring(0, currentdir.indexOf("ControlPanel"));
}else{
rootPath=currentdir;
[code]....
View Replies
View Related
May 5, 2014
My OS: Windows 7
Problem:
I've tried where javac in command prompt but it can't locate it. I need to know how to set JDK 8 as PATH.
View Replies
View Related
May 12, 2014
What I do wrong when I trying to set path to file in my jar app. I have application which work with xml file. I have next project structure:
/project_root_directory
|_ /lib
|_ /resources/file.xml
|_ /src
So, I need to set correctly path to my jar file, because when I running it from IDE, it works nice. By default it seems:
private File file;
private StreamResult streamResult;
file = new File("resources/file.xml");
streamResult = new StreamResult(file);
And methods where I can modify the DOM structure via transformer in end of methods:
transformer.transform(source, streamResult);
So, I trying set path to file:
private URL url;
...
file = new File(url.getPath());
streamResult = new StreamResult(file);
But it didn't not work, because when I trying to get resource by next condition
url = getClass().getResource("resources/file.xml");
url = getClass().getResource("resources/file.xml");url = getClass().getResource(url = getClass().getResource("resources/file.xml");resources/file.xml");
url - is null
Okay..
I tried next solution
InputStream input = getClass().getResourceAsStream("resources/file.xml");
There, I got also null....
Also, I tried made absolute path
filePath = file.getAbsolutePath();
file = new File(filePath);
streamResult = new StreamResult(file);
But it also didn't work. There I got message seems like: "Can't find resource /User/user1/Desktop/program1/resources/file.xml" - but that's really absolute path to a file.
Also, I tried made it via System.getProperty
String filename = "file.xml";
String workingDir = System.getProperty("user.dir");
finalfile = workingDir + File.separator + "resources" + File.separator + filename;
file = new File(finalfile);
I also made unit test which completed with "green light", but in jar its wrong with message "Can't find resource /User/user1/Desktop/program1/resources/file.xm" ....
View Replies
View Related
Sep 11, 2014
relative path not working if specified folder is outside eclipse IDE, but if i put same folder in current project it is working.
View Replies
View Related
Mar 2, 2014
I have BlueJ installed on my computer and it does the job of compiling the java source code written in it. If I want to write and compile source code outside of BlueJ do I still need to download the Java SDK and set the PATH variable, even though I am apparently able to do it in BlueJ?
View Replies
View Related
Feb 5, 2014
I have a data.json in my J2EE web app.I need to load it either from local path when unit testing or from url when the server starts up.
so I've set it to get the local path by default and what I'm trying to do is that it is is running on a server, I'd like to change the path to a url.
Here is my code:
public String getUrlBase(HttpServletRequest request) {
URL requestUrl;
try {
requestUrl = new URL(request.getRequestURL().toString());
String portString = requestUrl.getPort() == -1 ? "" : ":" + requestUrl.getPort();
return requestUrl.getProtocol() + "://" + requestUrl.getHost() + portString + request.getContextPath() + "/";
} catch (MalformedURLException e) {
e.printStackTrace();
}
return null;
}
which works fine. The only issue is that I had to place this in the login page. Is there a way I can only set the path to the base url upon server start up?
View Replies
View Related
Jan 8, 2014
When I write below command:
which mvn
I see below output
/usr/bin/mvn
But it is not the maven installed by me. I think it came with linux
Now I want to change mvn path with following command:
export M2_HOME=/usr/local/apache-maven/apache-maven-2.2.1
export M2=%M2_HOME%bin
But it does not change. I still see
which mvn
I see below output
/usr/bin/mvn
View Replies
View Related
May 28, 2010
I've just got a new computer and i tried to set the class path the way i did with windows xp but it's not working. This is what i have done. I added a Path variable to user variables and added C: Program Files (x86)Javajdk1.6.0_20/bin as the variable value. But when i got to command prompt and type javac HelloWorld.java it just tells me javac is not recognised as an internal or external command.
Also another problem is after trying this and it not working i tried to add a path to the system variables. I added a new path variable but i think once i did that it deleted the one that was already there. Is that going to mess up my computer? What the default path variable for windows 7 is?i've got the right destination as i typed cd to change directory and when i typed C: Program Files (x86)Javajdk1.6.0_20/bin it changed to that. And i noticed if i typed in the destination wrong its just made an error.
View Replies
View Related
May 8, 2014
I'm working on a project right now in JavaFX, and got stuck. I am drawing a path consisting of CubicCurveTo's and I wonder if there's any way to get the X and Y coordinates from certain parts of that path.
Imagine following a curve (path) with a pencil slowly, and every second you take note the X and Y coordinate. I mean I'm not interested in the control points or start and end points, but the points "in between", preferably at a certain interval.
I've searched for many things online, but have trouble knowing exactly which words to search for. "Paths" often bring up file paths, traversing, coordinates etc. all fail to give me any good results.
I tried to be as specific I could, and I don't think my current code is of any interest in this matter.
(The point of it all is that the path should simulate the path a person walks, and I will store the coordinates in a database for every second).
View Replies
View Related
Feb 10, 2014
I want to use the bit of code below to re-write the page to tell the user of a successful registration and then redirect them to another page. My problem is that I can't figure out how to get the path right for the login page. As can see, my first choice was to have the use click to the login page and when I use href it works fine.
I tried to use the entire file page starting at C and that didn't work. I also tried
${pageContext.request.contextPath}/Login
which is what I had to do for the action in the form for the login servlet page.
My question is what is the URL I need to use. By the way, if I jut put in google's URL, or any other for that matter, it works fine.
out.println(docType +
"<html>
" +
"<head><title>" + "Already Registered" + "</title>" +
"<meta http-equiv='refresh' content='3; URL='Login.jsp'></head>
[Code] .....
View Replies
View Related