java

java

  • All Sites

2 answers

Design for different Tokens

In my application I have Tokens. These Tokens are always enclosed in [ ]. A Token has an internal and an external Representation, e.g. a Variable´s internal Representation: [x] and the external ...

2 answers | 6 secs ago by HexFlex on Stack Overflow stackoverflow.com
2 answers

How to measure efficiency (in particular: assembly code) for java programs?

I have asked questions whose answers often faced me in the direction of efficiency. Rather than continuing asking these type of questions I would rather look beforehand at the efficiency. However ...

2 answers | 7 secs ago by Joop on Stack Overflow stackoverflow.com
1 answer

Java IO socket not sending outputstream

When debugging my code, the code stops here: while (( msg = reader.readLine()) != null) { writer.write("From server: " + msg); } I am sending input from a client class, but I can't figure ...

1 answer

How to properly use Mockito annotations in the given example?

I know there is an indirect answer to that question in other posts here on stackoverflow. For example this: link But I would need the most simple and direct answer to my particular question. Since ...

0 answers

Avoid security level blocking without adding url in exception site list

I have created java signed applet, it runs perfectly if I set my Java(JRE 8) security level high and added my site url in exception site list. But if we do not add site url in exception site list, ...

6 answers

static method with static default code?

Sorry for the bad title, but I found the code listed below on mkyoung.com and was wondering what this code does. Is this a way in Java to set some default value into a variable? public class ...

6 answers | 3 mins ago by Melauki Mawi on Stack Overflow stackoverflow.com
11 answers

Java: Parse a mathematical expression given as a string and return a number

Is there a way in Java to get the result from this mathematical expression: String code = "5+4*(7-15)"; Ie, what's the best way to parse an arithmetic expression?

1 answer

Handle more than one OWL files in a same JENA application

I am making an application which may require about 2-3 OWL files to work with, in order to serve different task for the same application. I am using Jena as my semantic web framework. My question is: ...

1 answers | 5 mins ago by djthequest on Stack Overflow stackoverflow.com
1 answer

Libgdx - IsometricTiledMapRenderer and light shading

I am wondering if there is any way to simulate light shading in Libgdx using an IsometricTiledMapRenderer. Here is my code to draw an isometric map, it's able to be moved around with the mouse and ...

1 answer

Is Java's URI.resolve incompatible with RFC 3986 when the relative URI contains an empty path?

I believe the definition and implementation of Java's URI.resolve method is incompatible with RFC 3986 section 5.2.2. I understand that the Java API defines how that method works, and if it were ...

1 answer

Eclipse plugin with external third party jar

I have an RCP application which includes different plugins. In one of the plugin I am using an external third party jar. Due to coyyrights reasons I cannot bundle that jar into my product. So I try to ...

2 answers

Java 8: Parallel FOR loop

I have heard Java 8 provides a lot of utilities regarding concurrent computing. Therefore I am wondering what is the simplest way to parallelise the given for loop? public static void main(String[] ...

0 answers

Issue with java - XML / Property is not recognized

I'm IT student in France and I feel sad with an issue in Linked Data ... I've already done a java app to post a SPARQL query with JENA API. It works fine. But I'm seeing the semantic web client ...

6 answers

Word count on Java

How can I count the words of a sentence given as string? We are allowed to use only the following: for loops, if statemant, while, charAt, length(). I wrote this code: public static int ...

6 answers | 8 mins ago by Oshrib on Stack Overflow stackoverflow.com
2 answers

Radio button doesn't change the state immediatley

In our project my teammate notice unusual behavior for radio button, when inside action listener there is SwingUtilites.invokeLater call. Archetecture of the action listener doesn't allow to avoid ...

0 answers

Getting WARN: SQL Error: 1205, SQLState: 41000 ERROR: Lock wait timeout exceeded; try restarting transaction. Saving a record in using hibernate

I'm new into java web application development and trying to save a record using hibernate in mySQL database but getting an error when trying to save the record. POJO Class package defaultpackage; ...

0 answers

Iterate over certain subpaths in Path in Java

I am working with code which makes use of java.nio.file.Path. I have a path like /tmp/something/first/second/third/last which I see only as {parent.dir}/first/second/third/{path.end} In this ...

1 answer

How to exit a method in ActionLister

I have an action listen connected to a JTextField and want to type something and it exits the method the Actionlistener is in. Code: main() { Security(x,x,x); } public void Security(JTextArea ...

4 answers

Partial execution of a synchronization block in java

I was just curious is it possible that a thread T1 say executes a synchronization block partially and then releases the lock on the object and another thread T2 executes the same block? Something like ...

0 answers

Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>

This error I see everywhere but I still find no solution to my deployment. I am using Eclipse Luna, jdk6, Spring, hibernate (3.3.2 GA), and maven 3.2.3, I run the application on a glassfish 3.1.2 ...

1 answer

How do I set the Background/ Layout of a class from a different class in Android

I am working with some code where I want to change the background image dynamically while referencing the shared preferences. An example of an activity I have is this: public class Splash extends ...

14 answers

How to automate download and installation of Java JDK on Linux?

As of around 15.04.2012 the wget command for the Java download link seems to be broken on Linux - is there a workaround? Is Oracle complying with the EU cookie law in your country by doing this? How ...

14 answers | 10 mins ago by thejartender on Stack Overflow stackoverflow.com
0 answers

How to update the settings of an HttpClient in httpclient 4.3+?

In httpclient 4.3, if you respect all the deprecations, you must build and configure your HttpClient using an HttpClientBuilder (documentation here). The methods are explicit, they seem easy to use, ...

1 answer

Spring Security custom authentication filter using Java Config

I'm trying to configure Spring Security using Java config in a basic web application to authenticate against an external web service using an encrypted token provided in a URL request parameter. I ...

1 answer

eclipse plugin: check selected project is closed or open

I created a plugin which queries the selected project Name & Path. Here is the code: IStructuredSelection selection = (IStructuredSelection) window.getSelectionService().getSelection(); Object ...

1 answer

What in my code can be indentified as virus?

When I finish to do my home task, I get error "could not find or load main class". I spent near 20 minutes in fully disunderstanding. Reason was "Kaspersky Anti-Virus", which was blocking my ...

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

Apache Axis2 - Class Not Found TypeSystemHolder

I'm new in Apache Axis2. I'm tryin to make simple web service client with wsdl url. I run this command below and it generate files including TypeSystemHolder.class in ...

3 answers

How to close AVD Manager in eclipse Luna

I am now using eclipse luna(earlier used is juno i shifted system and now use this ).Juno provides a cancel button but this is a new envoirnment for me.Inside this i was trying to create emulator.But ...

1 answer

InputMap for multiple keys

I want to have a custom Tab and Shift+Tab listner in my Swing Application. This works fine for a JTextField textField when the TAB Key is pressed=> ...

1 answers | 15 mins ago by devaldcool on Stack Overflow stackoverflow.com
2 answers

Connecting android app to Microsoft SQL server 2008

First of all. I am new to android application development environment and I am trying to connect to mssqlserver 2008 with simple android application using jtds-1.3.1.jar driver . I googled many ...

15 30 50 per page
1 2 3