java

Is there a good library to embed a command prompt in a scala (or java) application.

I have an application that I'd like to have a prompt in. If it helps, this is a graph database implementation and I need a prompt just like any other database client (MySQL, Postgresql, etc.). So far I have my own REPL like so: object App extends Application { REPL ! Read } object REPL extends Actor { def act() { loop...

Maven - Installing JAR not available in public repositories (in Eclipse)

When I deploy a successfully build Maven Project, from Eclipse, to Tomcat: the application complains that the jar file is not found. Steps taken: 1) Installed JAR in local Maven repository: mvn install:install-file -Dfile=xmlrpc-1.1.jar -DgroupId=org.apache -DartifactId=xmlrpc -Dversion=1.1 -Dpackaging=jar 2) Edited the POM file in ...

execute java program in the background while loading a page using php

I am trying to run a java program in the background using php. I am able to the run the program but the page doesn't load till java program completes executing. I am able to run shell scripts in the background using php. But if i give the same command for java, it doesn't run in the background. $command = "java hello"; $outputfile = "o...

java gui removing a label using JButton

What i need some help with is removing a label and creating a new one with a button click. At the moment this will add a new label but won't remove the old. I can't find a command that will work, northpanel.remove() will destroy the panel and the previous label, but then i can't create any new ones. import java.awt.*; import java.awt.ev...

First year prgorammer needs help with a nullpointer exception in java

As a portion of a first year assignment, I need to create a class which uses a provided linked list implementation to implement a provided stack interface which is then tested by another provided class. I was able to easily complete the assignment using my own LL; however, I was told that I needed to use the one provided. Exception in ...

Apache Ant v1.8.1: Error resolving loaded properties that include references to common properties

This worked in Ant 1.7.1 but no longer works in Ant 1.8.1. Is this a bug or is there a new and/or better way to achieve what I'm trying to do? The Project consists of 2 components, each component has it's own build file and properties file, there is also a top level build file and properties file for common ant targets and properties. I...

Using <mvc:resources .../> in spring 3 causes all other views to stop working

Simplest example: I have a dispatcher servlet configured to catch everything: <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> I have a simple test controller: @RequestMapping("/index") @ResponseBody public String rootTest(){ return "Main page displayed from TestC...

how to use regular expression in EJB named query

I have query in mysql like SELECT COUNT(DISTINCT MOBILE) FROM TBLM_CUSTOMER WHERE MOBILE NOT REGEXP '^00*0$' AND LENGTH(MOBILE) >= 10; I am using EJB 3.0 and I want to make same query using NamedQuery, same thing is possible using createQuery , but i want to use NamedQuery. Is it possible to use regular expression using NamedQuery in...

How to find which of the first 1024 ports seem to be hosting TCP based servers on a specified host?

I want to solve my problem using and I use java programming language. ...

Mapping a byte[] that can grow up to 400KB on MySql

Hi, I have the following: @Entity public class ExamplePhoto { ... @Column(nullable= false) private byte[] photo; ... } I am using Hibernate and a MySql database. I tried putting a mediumblob but got a "tinyblob expected error" message. Given the fact that the photo could be of up to 400KB the tinyblob won't do the job. How can I m...

Java newbie having problem with null point exception.

Trying to use StackLL method size() is returning a null pointer error. I cannot figure out why this is, as count is initialized to 0. My only guess is that I am not properly creating an instance of LinkedList.java. However, I have no idea what I should do to correct this. Any help would be greatly appreciated. The following code is a po...

Java & JSP Tutorial

Hi, Can any one guide towards a good Java & JSP Tutorials(videod/Books etc),it should be for basic as well as advance developers with alot of coding examples.I googled alot but couldn't find any thing useful. Thanks ...

Is there a convention for maintaining both a free and pro app version from the same codebase in Eclipse?

I am releasing two versions of an app--free and paid. The differences between the two are few, and I would like to release both using the same codebase (maybe a different constant defined for the other build?). Has anyone done this? Can someone point me in the right direction? Thanks! ...

Migrate TimeZone to DateTimeZone

I am experimenting to Joda time. final String string_from_3rd_party = "GMT+08:00"; // Works for standard Java TimeZone! System.out.println(TimeZone.getTimeZone(string_from_3rd_party)); // Exception in thread "main" java.lang.IllegalArgumentException: The datetime zone id is not recognised: GMT+08:00 System.out.printl...

.NET or Java ? Which one land me a job ?

Hey, I am currently in the final semester of my 4 year Computer Science Program . In a few months time, I will be looking for a Software Engineering job. I am looking to become a specialist in some language/technology and I cannot decide between .NET and Java.. Which one is more likely to land me a good job? Which one will be used in ...

Nested if-statements without brackets

Hi, following code is given: if (c2-c1==0) if ( c1 != c3 ) {...} How do I interpret this code? The first if-statement comes without {}. Is the code above equal to the following code?: if (c2-c1==0){ if ( c1 != c3 ) {...} } ...

windows BAT file for java

I have a stanalone application with a main class which used to run a windows BAT file ,the BAT file which invoke another java class(B),the class B refer so many JARs and configuration files which i configured through "build Path" Now I want to refer the JARs and configuration files in BAT file.How I write the BAT file. ...

Java I/O vs. Java new I/O (NIO) with Linux NPTL

My webservers use the usual Java I/O with thread per connection mechanism. Nowadays, they are getting on their knees with increased user (long polling connection). However, the connections are mostly idle. While this can be solved by adding more webservers, I have been trying to do some research on the NIO implementation. I got a mixed...

video list view not working...

hai now i am create list view and i want to display name, size,data in the list view now i am stored in my video in this path= /data/Video Thumbnails... i run the program emulator display the empty black screen only....what mistake i made for my coding please help me....reply please.... this is for my coding ViewVideo.java package vide...

Representration of a Empty Class Array

Hi Guys, I am actually looking at getting the method, whose name is stored in the string "methodName", from the Class "CC1" using Java Reflection. Method actualMethod= CC1.getMethod(methodName, parameterTypes); This is the syntax. The problem is the method takes no parameter. How do I represent that in the parameterTypes ? where p...