java

java

  • All Sites

1 answer

Why lambda expressions in Java 8 requires variables used inside it to use “final” modifier, but not when using method reference?

Consider following class: class Foo<T> { void handle(T t) { System.out.println("handling " + t); } public static void main(String[] args) { List<Integer> ...

3 answers

Overloaded constructors

After reading overloaded constructors from a book, i tired the following code: public class Employee { String name; int idNumber; public Employee(){ this("JJ", 0); ...

0 answers

Communication between two applications via WebService

I need to create two java projects in eclipse that communicate via a Web Service. For that I created first a Web Service and a Web Client following this tutorial ...

0 answers

JAX-WS not working when using `requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,URI);`

I am starting to learn how JAX-WS wroks. I have launch a webservice like this: public class LanzadorAgenda { private static final String SERVICE_URL = "http://localhost:8080/TelephoneList"; ...

3 answers

Best way to parse commands in a java text-based game

I'm developing a text based game in java and I'm looking for the best way to deal with player's commands. Commands allow the player to interact with the environment, like : "look north" : to have a ...

3 answers | 4 mins ago by AwaX on Stack Overflow stackoverflow.com
2 answers

Extensible and testable FizzBuzz

There seem no end to fizzbuzz implementations. Something I rarely see is an implementation that's easy to extend with more name-divisor pairs. Another thing that usually annoys me is the lack of ...

0 answers

Best way to store this in mapdb?

so I'm trying to do something with MapDB and I've run into a wall. I'll try describing it best I can: I have four pieces of data, we'll say it goes like this: 1) String action; //the name of the ...

2 answers

Using @ModelAttribute on a method argument

As said at this link under section Using @ModelAttribute on a method argument An @ModelAttribute on a method argument indicates the argument should be retrieved from the model. But i have ...

2 answers | 8 mins ago by user3198603 on Stack Overflow stackoverflow.com
0 answers

Google Drive Realtime for Desktop Application

I am investigating the Google Realtime API and I cannot figure out if it is possible to use it in a desktop Java application (using JavaFX)? I know next to nothing about JavaScript (or web ...

1 answer

How to email xslt reports to list of users given in a xls file?

I am able to generate XSLT reports after successful completion(execution) of build(pass/fail). I want to email this report to email addresses those are mentioned in the excel sheet.There are not too ...

0 answers

BouncyCastle: mac check in GCM failed

I have the following class defined in an application: @Entity @Table(name = "SETTINGS") public class Settings { @Id public int id; private String sharedSecret; @Transient ...

2 answers

SQLite insert into error (Android)

Error 12-22 14:30:52.329 1261-1261/com.TrackApp.trackapp E/SQLiteLog﹕ (1) near "Throw": syntax error 12-22 14:30:52.329 1261-1261/com.TrackApp.trackapp D/AndroidRuntime﹕ Shutting down VM 12-22 ...

3 answers

HTML tag regex doesen't work

Why this code doesen't return "" ? What regex should I use to replace all tags from a html file? x = x.replaceAll("<.*>", "<h3><a href=\"#\">current ...

3 answers | 14 mins ago by Cosmin Mihai on Stack Overflow stackoverflow.com
2 answers

Java: How to extract matching lines from a large text file fast?

Although aware that there are plenty of offered solutions to my problem in general, I am still not satisfied with the runtime they require in my special case. Consider a 35G large text file in FASTA ...

1 answer

Opening a file in a different package in Java program

I am trying to open a pdf file in my java code. The pdf (named "test.pdf") is saved in packageA. The class (ClassB) trying to open the file is in packageB. I am using the following code: try { ...

1 answers | 15 mins ago by user3245747 on Stack Overflow stackoverflow.com
0 answers

Bluetooth Client Server Connection

Am having great issues with building a client server model for my Bluetooth application. I run my Bluetooth server application on a mobile. Here is the code for that: public class BlueSer extends ...

1 answer

Intelij idea error “Could not find or load main class” when trying to add “-Djava.library.path” as vm option

I have a Windows 64 bit pc. I'm trying to connect a Java program to my Arduino. This site says I have to use this as the command line argument: "java -Djava.library.path='RXTXcomm.jar location' ...

0 answers

JTextPane resizing in a JPanel

I'm attempting to create an IM program as a sort of hobby project. I've been experimenting with UI designs and have been trying to get this prototype for the actual message display working. ...

0 answers

Import multi-module Maven project to Android Studio

I have a project that is to be deployed to different platforms, for now it's Desktop and Android. The project currently is managed by Eclipse, ADT, Maven and m2e. I have usual Maven project structure ...

0 answers

Playing MP3 with JavaFX

I'm working on something that essentially consists of a music server and a client. The server sends a list of songs to the client and the client then sends back a chosen song. The plan is to have the ...

0 answers

How to properly exit standalone Java Play Framework script?

I am using Java Play Framework 2.3.7 and have a standalone script that uses StaticApplication and imports stuff into my database that I want am able to run manually using the runMain command. Mostly, ...

1 answer

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException when making an insert to a database

I'm making a inserting program for database .. I've simply a textbox to insert an article into my webpage. When i insert this article: But while the results are pretty exciting, it's important ...

1 answers | 20 mins ago by raja lala on Stack Overflow stackoverflow.com
1 answer

my css dont show if i put my css folder inside the WEB-INF folder

hi i'm working in a spring mvc project and i have the following problem this is my folders hierarchy --src --main --webapp --WEB-INF --views --css ...

1 answer

Analysing Algorithms Big Oh/Complexity theory

I'm revising for my finals and from looking at previous exam papers I have a found a popular question that has came up almost every year, worth a lot of marks. Each year the question is written very ...

1 answers | 22 mins ago by user26090 on Computer Science cs.stackexchange.com
1 answer

android: major prob with detecting angle of device inclination

For a project I need to detect the inclination (pitch) of an android device. For that, I use the acceleration sensor and the magnetic field sensor and everything works fine. The device is able to move ...

0 answers

why my jsonParser using Streaming API use much more memory

I have code which jsonparse the whole file: ConcurrentHashMap<String, ValueClass<V>> space = new ConcurrentHashMap<String, ValueClass<V>> (); Map<String, ...

0 answers

Java is blocking all proxmox consoles, can't add it to site exception list

I cannot run a Proxmox console on windows 7, as Java keeps blocking the page. The url for it is https://proxmox.dis:8006 (.dis being our local domain name) Typically I just need to add the site to ...

3 answers

Generating BigInteger digits then multiplying.

I'm trying to generate big integer numbers with X amount of digits. I thought I had it figured out until I realized that the code below was creating Bits, not digits. I've been trying to figure out ...

3 answers | 25 mins ago by Bob on Stack Overflow stackoverflow.com
1 answer

How can I find which java class reads a particular xml file?

I'm workin on a java application for which i don't have all the source codes. The application is based on spring framework, and at startup it parses lots of xml files from different directories. Then ...

1 answers | 25 mins ago by Szilard on Stack Overflow stackoverflow.com
3 answers

Differences between m2eclipse and maven command line

I am having some issues with building a project via the maven CLI and Eclipse: When I build the project in Eclipse, I have no issues. When I build the project in a shell, I get an error that the ...

3 answers | 25 mins ago by Delmania on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3