w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to access a file in the root of the android project, java path
It is tricky accessing the a resource from the project since after the .apk is build the local file system on the phone is accessed and not the project files. My solution is putting the files that I need to access in the project/assets file and then they can be acesed ussin the getAssets() method. So the path is like this: myProject/assets/config.properties myProject/src/com/testProject/util/Configuration.java and the code inside Configuration.java is: AssetManager manager = context.getAssets(); stream = manager.open("config/config.properties"); So the important thing is that only files inside the assets folder can be accessed, and also you need a context to call the getAssets() method.

Categories : Java

What is the correct escaping or quoting of whitespace in a classpath (!path) element in FitNesse?
Ok, so the first thing to note is that this phenomena does not happen on Windows. FitNesse automatically encloses classpath elements contained whitespace with double-quotes, as already noted in the question. The command which FitNesse generates is: java -cp fitnesse.jar:"/home/stewart/white space test/example-1.0.0-SNAPSHOT/target/test-classes":"/home/stewart/white space test/example-1.0.0-SNAPSHOT/target/classes":/home/stewart/.m2/repository/org/fitnesse/fitnesse/20121220/fitnesse-20121220.jar fit.FitServer linux-desktop 9123 10 On Windows, this would be: java -cp fitnesse.jar:"C:white space testexample-1.0.0-SNAPSHOT arget est-classes":"C:white space testexample-1.0.0-SNAPSHOT argetclasses":C:.m2 epositoryorgfitnessefitnesse20121220fitnesse-20121220.jar fit.FitServer windows-desktop

Categories : Java

Add eclipse project lib to maven build path?
There is a workaround to use non maven project in maven dependencies, we should not use it, but when we have not the choice, use the "system" scope: <dependency> <groupId>org.yourjar</groupId> <artifactId>yourjar</artifactId> <version>0.1</version> <scope>system</scope> <systemPath>${project.basedir}/lib/yourjar.jar</systemPath> </dependency>

Categories : Android

Eclipse library path error after moving project to git repository
I found the answer to this question to be helpful: Cannot Add Library to Android Project in Eclipse. It wasn't enough to add the libraries back in manually. Doing Project->(right click) Properties->Android->Add and then adding the library made it work (#4 in answer I linked). Update: on a couple of other projects I tried this with, I also needed to close the project [(right-click)->Close Project], and re-open it (double-click). Then I tried to run it; it failed once; then worked. To sum up, this is what worked for me the most reliably: 1) Properties->Java Build Path->Libraries->Add Jar to add my libraries 2) Properties->Android->Add to add them again for real somehow 3) Close and reopen project 4) Attempt to run; fail; errors go away; run again. Success. Sigh.

Categories : Android

Adding Android library project to Eclipse build path?
Since the library projects are in the same workspace, we can reference the project directly. Open the preferences for your project and click on the "Android" section. Now, you will see a window for referencing library projects. Click the "Add..." button, select the projects you want, click "OK", and hit "Apply". Only projects that are marked as libraries can be selected and referenced in this manner. If your projects are not appearing, open their preferences and mark the "Is Library" box in this window of their preferences. Your project will now reference these libraries, including any changes you make to them. This is better than using a jar if your libraries will be subject to change. Otherwise, you would have to remove and re-add the jar every time you make a change.

Categories : Android

How to find path of current selected project in eclipse plug-in
public static IProject getCurrentProject(){ ISelectionService selectionService = Workbench.getInstance().getActiveWorkbenchWindow().getSelectionService(); ISelection selection = selectionService.getSelection(); IProject project = null; if(selection instanceof IStructuredSelection) { Object element = ((IStructuredSelection)selection).getFirstElement(); if (element instanceof IResource) { project= ((IResource)element).getProject(); } else if (element instanceof PackageFragmentRootContainer) { IJavaProject jProject = ((PackageFragmentRootContainer)element).getJavaProject(); project = jProject.ge

Categories : Eclipse

Adding in a python module to the sys.path for a Java project in pydev, Eclipse
Having spent a few seconds looking at the documentation (so I've no ide if this actually works), it looks like you can use pass in a PySystemState to the PythonInterpreter constructor. The PySystemState has a public path field that (I assume) you can append path entries to. UPDATE As you want to specify the path in the runtime configuration, then it looks like you can do this by specifying the python.path system property on the command line (from the Jython FAQ): Properties props = new Properties(); // set in the VM args in the Eclipse runtime configuration instead // props.setProperty("python.path", "/home/modules:scripts"); PythonInterpreter.initialize(System.getProperties(), props, new String[] {""});

Categories : Java

Error in eclipse: “The project cannot be built until build path errors are resolved”
I was getting the same NullPointerException in Eclipse that came with Android SDK, then I did the following (explaining in step by step process): Go to Help and click on Install New Softwares. A Install window will open, click on "All available sites' and then there will be a text box to search for the softwares you want to install, enter 'Eclipse' there. A lots of Eclipse related softwares will come up. Select Eclipse Platform, Eclipse Platform SDK and Eclipse SDK and then click Next...Next...(and all the Next)...Accept All the Agreements...Finish. In some time it will install all the softwares and you'll have to restart the eclipse and you'll be good to go. This resolved my issue. Hope this helps you.

Categories : Eclipse

How to get src folder under project-root folder in github when staging from eclipse using egit
it cannot be done using eGit - it assumes the Eclipse project structure. But it can be accomplished by using git itself. Just create a repository under SimpleGit folder executing 'git init'. From that point on you'd have to manage your git repository by either git itself (command line) or some other UI. SourceTree works really well for me.

Categories : Eclipse

PHP: fopen path for `include`d script using Apache Document Root when full path is specified?
If the Path starts with / It will point to the root Filesystem which is fine with CLI but CGI would understand it this way: /home/jweinberger/com.example/logs/script1.log//home/jweinberger/logs/script1.log You should use the index 'DOCUMENT_ROOT' from the $_SERVER array. fopen($_SERVER['DOCUMENT_ROOT'].'/home/jweinberger/logs/script1.log')

Categories : PHP

SBT: How to make one task depend on another in multi-project builds, and not run in the root project?
I may be wrong, but you are defining the verify task dependency only for the current project. Maybe you can try: Seq( verifyTask in Global := {}, verifyTask <<= (verifyTask in Global).dependsOn(scctTestTask, scalastyleTask) ) Or you can add the verifyTask settings to all your modules.

Categories : Scala

Gradle: Project "x" not found in root project "myProject"
You need to migrate your Eclipse project in order to have a build file (build.gradle) Migrating from Eclipse : Update your Eclipse ADT Plugin (you must have version 22.0 or higher). In Eclipse, select File > Export. In the window that appears, open Android and select Generate Gradle build files. Select the project you want to export for Android Studio and click Finish. Your selected project remains in the same location but now contains a build.gradle file and is ready for Android Studio. Then, Android Studio will be able to build your project using this build.gradle file.

Categories : Android

Eclipse (Kepler): Qt project as subdirectory in eclipse project
Indeed, you need to use the external tools. Add these in there: "qmake -project" and "qmake". The former is obviously not necessary if you have project file(s) already in there. You can then set the working directory, and arguments like the project file. Then you can just run the externals tools from the menu. I am not sure what you mean by "Qt makefile" and by "Eclipse not seeing it."

Categories : Eclipse

What's the use of the configuration in classpath for Eclipse project: "org.eclipse.jdt.junit.JUNIT_CONTAINER/4"
Your project needs to use JUnit libraries to run JUnit tests. The entry in CLASSPATH specifies the location of these libraries; in this case it's JUnit 4 from Eclipse. You can use some other version (3, for example) or libraries which are not part of Eclipse. To add this library you can use Eclipse UI. Open project properties, go to Java Build Path, then open Libraries tab. Then click Add Library, you'll get a list of libraries where you can choose JUnit. You have to do it every time you create a new project with JUnit tests.

Categories : Java

Java Eclipse open 2 tabs eclipse.exe and project
i was able to solve my problem adding the line to the FIRST LINE in eclipse.ini file something like -vm C:/Program Files/Java/jdk1.7.0_21/jre/bin/javaw.exe yes in 2 lines not in a single line. my eclipse.ini is like this ready now. -vm C:/Program Files/Java/jdk1.7.0_21/jre/bin/javaw.exe -startup plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222 -product org.eclipse.epp.package.jee.product --launcher.defaultAction openFile --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m i hope really helps somebody.

Categories : Java

How do I use a Java project that requires a 1.7 compliance level on an Android project build path?
Try to clean your project, and fix android properties. Link here and here

Categories : Android

java servlet project and android library project in eclipse - NoClassDefFoundError
First of all - I believe Java Web Project will not work with any of Android specific classes due to many reasons. If your MonitoringModel contains some Java code that you want to share between Android and Web application you can extract it to separate Java project and use a Link Source option in Properties->Build Path to link it to both projects.

Categories : Android

NoSuchMethodError occuring in normal java project and not in J2EE project ( Eclipse)
NoSuchMethodError happens when you write code for one version of a class and then run it with another that does not have a the method that you use. From the documentation: Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed. Make sure that you have the same versions of the library that is giving the error in both environments. If the error is thrown for a method that you wrote yourself you have a mixture of classes from different builds. Try deleting all class files and doing a clean build.

Categories : Java

Eclipse: How to import git project as library for Android Project which has to be pushed to Bitbucket
If the library is a .jar file, you can simply paste it into the libs folder of your app. Android should automatically add it to the build path. As far as pushing/pulling from BitBucket goes, as long as you add the .jar file in git the library will be committed like any other file.

Categories : Android

How do you include files from a scala project in eclipse in a java project in netbeans
If you are developing a library in your Scala application, i would suggest to use sbt and package the library as a jar and import that jar to your java project. You will have to define a build file in sbt. I am not sure whether you already defined it and use the sbt package command. sbt package Try using sbt

Categories : Java

Eclipse Build Error "A class file was not written. The project may be inconsistent, if so try refreshing this project and building it"
We are using Eclipse here too and have to handle a workspace with more than 200 plug-ins. Every now and then people have similar problems with their workspace and inconsistencies reported in a weird way by Eclipse. What people here usually do is (next step only in case previous step didn't help): - trying to ContextMenu->Team->Clean/Refresh the whole workspace - creating a new workspace and check out all necessary files from the repository - reinstalling Eclipse to a new directory From my experience after using the Eclipse IDE on a daily basis for many years, it doesn't make very much sense to waste too much time with these issues, unless they aren't solved by one of the steps above. It takes too much time to struggle with these things, while starting from scratch is done in an hour or le

Categories : Eclipse

Unable to acces files of other project in a eclipse java project
Make your resources folder also as a source folder. Select Project A, go to project > properties, under java build path> source tab, add resources folder. This will make sure all your files available in resources are copied to bin folder and can be referred as classpath resource.

Categories : Java

Creating a Maven Artifact from (Eclipse) Project, and Generating New Project from it
You need to run the archetype plugin from within your original project to generate an archetype descriptor. Here is an example of how to do this. The complete steps are listed here: http://hello-its-crazy.blogspot.in/2012/08/steps-to-create-maven-archetype-from.html

Categories : Java

Convert an Eclipse "Makefile project from existing code" to an AVR project
Close the project and add the following to the .project file: <nature>de.innot.avreclipse.core.avrnature</nature> This goes at the end of the <natures> section in that XML file. Re-open the project and the AVR nature will have been added, and you can then see the AVR options. Source.

Categories : Eclipse

How to add dependency to Play framework project in Eclipse from second project?
If your two projects are tightly coupled, then a multi-project build probably makes the most sense. I found this blog post from fortytwo to be very helpful when setting up a multi-project build locally. When running play eclipse you should automatically end up with multiple Eclipse project files that have the correct dependencies. If your projects are unrelated, externalized dependencies might make more sense. From your first project you can run play publish-local to deploy the jar files to your local Ivy repository; the sbt docs explain how to configure publishing to a central repository. From your second project, you can add a "groupId" % "artifactId" % "1.0-SNAPSHOT" dependency that points to this artifact. Unfortunately Eclipse doesn't play nicely with this configuration, and you

Categories : Eclipse

Converting Maven project to Dynamic Web Project for Eclipse
WTP version is rather old, you should add a web project features instead. Edit the .project file and write under the natures tag <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> and under the buildSpec tag add builders <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand>

Categories : Java

Adding eclipse project dependencies to a Maven project
I'm not sure about your question 1, but if I understand it correctly, you would like to build with Eclipse two Maven projects where A depends on B? Then you may use an Eclipse plugin like m2eclipse. For your second question, I think the solution would be to use the system scope for your dependency that you can't find in any public repository. Of course, if you can deploy the dependency on an entreprise repository it would be better.

Categories : Java

Eclipse Project description - NOT .project file - is there such a thing?
Thats an interesting question we also face. Currently there does not seem to exist a solution for this problem. The only thing that could come near to providing one is the Mylyn Intent project, as it aims to provide a comprehensive documentation on design decisions, which takes into account the inter-dependencies between plugins. This inter-dependency is exactly the problem. There exist solutions to document the purpose of java packages which is limited to the classes however. Our solution is a readme.textile embedded in the root of each plugin, providing this specific information. It would, however, be interesting to introduce the documentation used for packages for bundle documentation, which could be used to autogenerate an overview documentation.

Categories : Eclipse

Eclipse: What is the Difference Between "dynamic web project" and a "java ee web project"
According to Jboss documentation, java EE web project "generates a Java EE 6 web project with JSF 2, JPA 2, REST and CDI support enabled. In your scenario, JPA 2, REST and CDI could be more than you need. You should go with dynamic web project, which is the standard profile for web applications. You could insert additional features such as JPA later, if you need them.

Categories : Eclipse

Using Maven To Add Root Path
Try using maven predefined variables. <resource> <targetPath>${project.basedir}/../src/Server-Parent/src/test/resources</targetPath> <file>${project.basedir}/../src/Server-Parent/DB/src/test/resources/mongoDB.xml</file> <destFileName>mongoDB.xml</destFileName> </resource> Some helpful variables ${project.basedir} ${project.build.directory} ${project.build.sourceDirectory} more info here

Categories : Java

what would be the path for the file in the root directory?
When you say "root directory" that usually means the root directory of a filesystem. On most *nix (Linux, FreeBSD, Unix) installs, that means your filesystem path is simply "/". That is, if your config file is there, your PHP file should look like this: <?php include('/config.php'); ?> However, it would generally be both a bad idea and would require superuser privileges to actually put a file at the filesystem root of "/". So it's likely (but we have to guess), that you mean the DOCUMENT ROOT for your web server. Most web servers running PHP make that value available via the super-global $_SERVER['DOCUMENT_ROOT'] as mentioned by Kai Qing in his comment. If that is where your file is, then you could put this in your PHP file: <?php include($_SERVER['DOCUMENT_ROOT']

Categories : PHP

Split-Path with Root UNC Directory
By using the System.Uri class and querying its host property: $uri = new-object System.Uri("\serverfolder") $uri.host # add "\" in front to get exactly what you asked Note: For a UNC path, the root directory is the servername plus the share name part.

Categories : String

php root path assigned to variable
That's a variable Scope problem, is your global variable in same scope? You can do $_GLOBALS["domain_path"] = $_SERVER['DOCUMENT_ROOT']; and use it like <?php include $_GLOBALS["domain_path"].'/common/head_info_'.AC_LANG.'.php'; ?>

Categories : PHP

Root path of site in CodeIgniter
If the uploads folder is in the root of your site then you can simply use ./uploads in your upload path configuration. $config['upload_path'] = "./uploads";

Categories : Codeigniter

What is the syntax of git's repository root path?
The colon : helps here, you can refer to the root of the repository by :/: git init test cd test mkdir a touch a/a git add a git commit -m a # Here comes the interesting part: cd a touch ../root git add :/ git commit -m root The script above initializes a toy repository that contains one single file a in a subdirectory a. In "the interesting part", it changes to the a directory, creates an empty file in the root of the repository and adds it using the :/ reference. The -u switch works as usual (not shown in the script). The manual of git-rev-parse reads: <rev>:<path>, e.g. HEAD:README, :README, master:./README A suffix : followed by a path names the blob or tree at the given path in the tree-ish object named by the part before the colon. :path (with an empty part b

Categories : GIT

Root relative path in MVC4 without @URL
I created a very simple MVC Controller to expose Routes that you need to access from javascript. You can find it at my GitHub -> https://github.com/tucaz/JSRouteController

Categories : C#

Eclipse bug: This project has the JPA facet, but no JPA project could be created
I had the same problem and resolved it by installing both apt and jdt connectors for m2e. Go to Window > Preferences > Maven > Discovery > Open Catalog. Look for m2e-apt and m2e-jdt-compiler. Install and then restart eclipse.

Categories : Eclipse

Using methods of a different Project (Project References in Eclipse)
You need to add the required project into the java build path of your project. Do this in eclipse: Right click on your project -> Java Build Path -> Projects (add the project you want to use)

Categories : Java

Can I check out an SVN project to a dynamic web project in Eclipse?
Have you seen Subversive. I use this plugin to checkout projects from SVN. The Subversive project is aimed to integrate the Subversion (SVN) version control system with the Eclipse platform. Using the Subversive plug-in, you can work with projects stored in Subversion repositories directly from the Eclipse workbench in a way similar to work with other Eclipse version control providers, such as CVS and Git.

Categories : Java

IIS MVC wrong root path points to localhost
You should be using a relative path from the application root, using this: <a class="logo" href="@Url.Content("~/")">Application</a> Note the ~ (tilde) before the forward slash. Also, an option would be to use the Url to an action: <a class="logo" href="@Url.Action("Index","Home")">Application</a>

Categories : Asp Net



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.