How To Change Maven Path

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


ADVERTISEMENT

Change File Extension On Path Name In JTextField

Nov 3, 2014

I have a GUI that has three jTextFiled's. The first on gets filled in with a file that I choose and shows the path to that file with the file name

i.e. - c:
s34bil.exe
un estrun.i

I want to change the file extension from .i to .r in one jTextField and then .i to .o in another jTextField.

I am slowly learning Java. I have this coded in VB, but not sure how to do it in java.

Here is the VB script :

Dim thefile As String = txtInput.Text
Dim fn1 As String = My.Computer.FileSystem.GetName(thefile)
Dim fn2 As String = fn1.Replace(".i", "")

[Code] ....

View Replies View Related

How To Manage Old Requests Due To Context Path Change

Jun 12, 2014

I had to change context path name of my web application due to some organizational shuffle. I have successfully changed it and it has been working fine.

But what is happening is we have used old context path name in reminder and notification emails. so When users hit links from old emails, they are getting 404 Error.

Is there any way to redirect the old request which has old context path to new one?

View Replies View Related

Trying To Import Library (Via Maven)

Feb 12, 2015

I have written a library in one project but cannot seem import to import it into my main project whenever I try Maven says it cant find it though it is installed in the repository and the .jar file is in the classpath.
 
mvn -v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:23+00:00)
Maven home: c:Mavenbin..
Java version: 1.8.0_31, vendor: Oracle Corporation
 
Stack trace
org.jclarion.clarion.lang.ClarionCompileError: Class Not Found:com.MyProj.app.MyClass near line:310 (selma012.clw)
        at org.jclarion.clarion.lang.Lexer.error(Lexer.java:190)
        at org.jclarion.clarion.compile.grammar.AbstractParser.error(AbstractParser.java:111)
        at org.jclarion.clarion.compile.grammar.AbstractParser.importJava(AbstractParser.java:463)
        at org.jclarion.clarion.compile.grammar.AbstractParser.emptyLex(AbstractParser.java:258)

[Code] .... 

Library POM
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.MyProj.app</groupId>
  <artifactId>MyClass</artifactId>
  <packaging>jar</packaging>

[Code] ....

View Replies View Related

Any Way To Download All Jar Files From Maven Repository

Apr 17, 2015

While going through stpring batch,every where there uses pom.xml. But in my office maven repo is blocked. How to get the jar files .

Is there any way to run pom.xml online and download required jar to my local drive. or how to run a pom.xml file after setting maven, I had done all the same but some unknown issues.

View Replies View Related

Recompiling Maven After Changing Code

Aug 9, 2014

I have a very basic question about the Maven. I compile 2 dependent projects on maven and they have a problem, then I change a code and I recompile the project.

After that in the jar file of this project, I see that the code is the same, the error also shows me that the file is the same ( from the error line i can understand that) ....

View Replies View Related

Use Relative Path In Place Of Absolute Path

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

Java Servlet :: Dynamic Web Project Using Maven In Eclipse

Jun 19, 2015

In my project, .class files of servlets are absent, because of some configuration mistake.

index.jsp

<html>
<body>
<h2>Hello World!</h2>
<a href="./MyClass">Click</a>

[Code] ....

MyClass.java:

package data; 
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; 
public class MyClass extends HttpServlet {
private static final long serialVersionUID = 1L;

[Code] ....

while execution of this project index.jsp executes fine but when servlet is called an error is thrown:

SEVERE: Allocate exception for servlet MyClassjava.lang.ClassNotFoundException: data.MyClass at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1128) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827) at

[Code] ....

Directory structure:

App1

->Deployment Descriptor:Archetype Created Web Application
->Java Resources
---->src/main/resources
------>data
-------->MyClass.java

[Code] ....

View Replies View Related

How To Set JDK8 As PATH

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

Set Path To File In Jar App

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

Relative Path Not Working

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

The System Cannot Find The Path Specified

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

Java Path Variable

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

Servlets :: Getting Path Of The Base URL?

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

System Cannot Find Path Specified

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

Class Path With Windows 7

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

JavaFX Get Coordinates From Path?

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

JSP :: Cannot Get Correct Path On Refresh

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

SQLite Database Path

Jan 19, 2015

I was asked to create an Android App with SQLite Database. I had referred some example and tutorial which can be found from the internet but 1 thing that is still unsolved.

The default path for Android SQLite is //data/data/<Your-Application-Package-Name>/databases/<your-database-name> which can be found in Eclipse DDMS after connecting the phone to the computer or the emulator is on.

I had tried many example and tutorial and yet I can only access to "data" file only and the rest (/data/<Your-Application-Package-Name>/databases/<your-database-name>)are never appeared on my screen. This is one of the website (URL....) I learnt to create my database app.

I had follow the steps exactly for many times but I still can't find the path. The app is running fine as it will show saved data/"contact" although I restart the apps(Which mean it did save my data but I just can't find where did it saved). What's wrong with my Eclipse?

View Replies View Related

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 View Related

How To Find Longest Path In A Matrix

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

JSP :: Choose / Display Image Path

Mar 15, 2014

I want to do the followings:

-When i press "choose the Image Path" a window open like a picture 2.
-I want also satisfy the condition written in red.

View Replies View Related

Servlets :: Context Path After Forward

Mar 23, 2015

I have normal adress which works, like

localhost/contextPath/foo

In URL rewrite filter I forward that call like

((HttpServletRequest) req).getRequestDispatcher(".....foo1.jsp").forward(req, res);

And it gets there. On that page (foo1.jsp) I have link to original href

<a href="localhost/contextPath/foo">click.</a>

When I click that, in url rewrite filter I get:

String url = ((HttpServletRequest)req).getRequestURL().toString();// http://contextPath/foo/contextPath/foo
String uri = ((HttpServletRequest)req).getRequestURI().toString();// /contextPath/foo/contextPath/foo

which is bad address. How to handle that and why it happens ?

View Replies View Related

How To Find The Current Path Of A File

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

Finding Path Through 2D Array From Top To Bottom?

Apr 20, 2015

I have a 2D array that is of type int[][]. it is populated with 1's and 0's. I need to create a method that allows me to search from the top row finding a possible path to the bottom--the path is a path of connecting cells containing 1. I need to create an array that stores the cells that are needed to be searched. When the search carries out, for each cell stored it needs to check the cells to the left, right, below and above the current cell.

I also need to create a variable to store the current cell. I thought initially it would be an int but it can't be because it needs to hold the the index of the current cell. and any of the cells searched that are an immediate neighbour of the current cell are added to the storage array.

I have these instructions but I am having trouble converting into code

Finding a path through vegetation from the top row to the bottom row: The idea is we will start from a cell in the top row and advance below for as long as we can. Since we are still not done exploring a cell until we have explored ALL it’s vegetation neighbors, we will add the cell to an array of cellsToExplore and only come back to it if the current cell we are examining is fully explored. Here is pseudo-code of the algorithm !

• Create array cellsToExplore (what size should this array be?)!

• Create an integer count that stores the number of cells in cellsToExplore!

• Go through the top row and add ALL vegetation cells to cellsToExplore!

• Create a variable to store currentCell we are exploring and set it to null.!

• while count > 0 do!

- set currentCell to the last cell in cellsToExplore (last cell added to the array).!

- label currentCell as burning vegetation!

- If the currentCell is on the bottom row then we return true (we found the path).!

- if the cell below currentCell is vegetation then add the cell below to the cellsToExplore array.!

- else if cell to the right of currentCell is vegetation then add the cell to the right to cellsToExplore!

- else if cell to the left of currentCell is vegetation then add the cell to the left to cellsToExplore!

- else if cell above the currentCell is vegetation then add the cell above to cellsToExplore.!

- else remove the currentCell from the cellsToExplore (we are done with this cell). !

• Return false!

View Replies View Related

Simple Agent Find Path?

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







Copyrights 2005-15 www.BigResource.com, All rights reserved