Is there Ruby Version Manager (http://rvm.beginrescueend.com) equivalent for the Java world?
I'm looking for tool which allow me to easily download and install a new JVMs and switch between them. For example:
jvm install <version>
jvm list - will list installed JVMs on my system
jvm use jdk1.6 - will switch my env to jdk 1.6 version, etc.
I am developing a flex java - spring web app and have set up the business logic using hibernate.
I want to maintain sessions so that when the user logs in , i can track the logged in user to display information that is related to the username.
I want to do this using spring if possible and wondered if anyone could redirect me to a tutorial or even explain the method to which this is achieved , or if it is hard to achieve.
Thanks
Chris
Hi,
I want to use JpaInspector class that is written for Metawidget. However when I insert this class into my Java project in Netbeans 6.8, It gives an error for inspectProperty() method of JpaInspector class, "method does not override or implement a method from supertype". Does it mean that parent class of JpaInspector, that is BaseObjectInspector, does not have such a method? Or what should I do to use JpaInspector in my project?
Thanks.
I'm creating an email using String Template but when I print out a date, it prints out the full date (eg. Wed Apr 28 10:51:37 BST 2010). I'd like to print it out in the format dd/mm/yyyy but don't know how to format this in the .st file.
I can't modify the date individually (using java's simpleDateFormatter) because I iterate over a collection of objects with dates.
Is there a way to format the date in the .st email template?
Hi folks,
I have a little program allowing users to type-in some regular expressions. afterwards i like to check if this input is a valid regex or not.
I'm wondering if there is a build-in method in Java, but could not find such jet.
Can you give me some advice?
Best regards
Phil
I've spent far too much time trying to figure this out. This should be the simplest thing and everyone who distributes Java applications in jars must have to deal with it.
I just want to know the proper way to add versioning to my Java app so that I can access the version information when I'm testing, e.g. debugging in Eclipse and running from a jar.
Here's what I have in my build.xml:
<target name="jar" depends = "compile">
<property name="version.num" value="1.0.0"/>
<buildnumber file="build.num"/>
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<manifest file="${build}/META-INF/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Built-Date" value="${TODAY}" />
<attribute name="Implementation-Title" value="MyApp" />
<attribute name="Implementation-Vendor" value="MyCompany" />
<attribute name="Implementation-Version" value="${version.num}-b${build.number}"/>
</manifest>
<jar destfile="${build}/myapp.jar" basedir="${build}" excludes="*.jar" />
</target>
This creates /META-INF/MANIFEST.MF and I can read the values when I'm debugging in Eclipse thusly:
public MyClass()
{
try
{
InputStream stream = getClass().getResourceAsStream("/META-INF/MANIFEST.MF");
Manifest manifest = new Manifest(stream);
Attributes attributes = manifest.getMainAttributes();
String implementationTitle = attributes.getValue("Implementation-Title");
String implementationVersion = attributes.getValue("Implementation-Version");
String builtDate = attributes.getValue("Built-Date");
String builtBy = attributes.getValue("Built-By");
}
catch (IOException e)
{
logger.error("Couldn't read manifest.");
}
}
But, when I create the jar file, it loads the manifest of another jar (presumably the first jar loaded by the application - in my case, activation.jar).
Also, the following code doesn't work either although all the proper values are in the manifest file.
Package thisPackage = getClass().getPackage();
String implementationVersion = thisPackage.getImplementationVersion();
Any ideas?
Could anyone tell me the difference between library and native library in terms of java? I found the word "native library" in the following line:
Type 1 - drivers that implement the
JDBC API as a mapping to another data
access API, such as ODBC. Drivers of
this type are generally dependent on a
native library, which limits their
portability. The JDBC-ODBC Bridge
driver is an example of a Type 1
driver.
which you can found here
Is there a way to print numbers from 1 to 100 without using any loops or conditions like "if"?
We can easily do using recursion but that again has an if condition. Is there a way to do without using "if" as well? Also no repetitive print statements,or a single print statement containing all the numbers from 1 to 100.
A solution in Java is preferable.
How can I parse a strings like :
name1="val1" name2="val2" name3="val3"
I cannot use split(\s+) as it can be name = "val 1".
I am doing java but any laguage is okay.
I am currently picking up Grails and Roo to expand my skills and to have a bit of fun.
The vast majority of training materials appear aimed at new developers or Java developers.
Does anyone know of any guides, resources or have any tips and anecdotes for translating existing development experience with .Net (C#/ASP.Net/Asp.Net MVC)?
I can't seem to find any example of how to do this. Imperatively in java it would be a piece of cake of course, but I can't seem to figure out how to inject my JaasVerifier into my SpringComponent declaratively from within the xml.
It appears from the method signatures that Verifier is designed to be attached to Context, but the instance of Context itself is created as a side effect of the SpringComponent creation so I can't get a hold of it in Spring. There must be something I am missing.
Hi,
I'm not familiar with Java but I need to make a request to a remote webservice from within my applet.
The webservice (.Net 1.1) uses HttpContext.Current.Request.UserLanguages[0] to determine the language to use. But the value of this member is alway null.
So is there a way to pass the Accept-Language header along with something like "en-GB" set?
2 Interfaces with same method names and signatures. But implmented by a single class then how the compiler will identify the which method is for which interface.In java.
We are doing one project. We have to develope website, that displays all proxy servers list and when user click on particular server it will be activated to him.
For this I am confusing on use Java or PHP. which is simple to handle proxys.
Please help me.
I have a set of points in 3d space and I want to be able to categorize the shape that best fits them - cube, sphere, cylinder, planar (flat) etc.
I've looked at supervised/machine learning but since I need first generate a large training data set that's not really suitable.
My dream solution would be a java library with a wonderful magical function something like :
public enum ShapeType {
CUBE,
SPHERE,
CYLINDER,
PLANAR
}
public ShapeType CategorizeShapeFromPoints( 3DPoint[] points )
However, any and all help will be appreciated. Thanks
I'm new to java can someone please explain to me whats wrong with this method:
clas Hello {
public static void main (String[]arg) {
Document.write ("hello world") ;
}}
We are looking for open source tool for hosting our internal projects like "Google Project Hosting". The tool should support individual wiki and version control for each project and it should be easy to configure for each project like in google code. We explored trac but seems it lack good support for multiple projects. The tool will be installed in our internal host and cannot use hosted service. A java based tool will be ideal.
hi
Oracle [Sun] don't let downloading anything from their websites for people from iran.[sad story for us because we are students and Researcher...]
i need to samples of this tutorial : http://java.sun.com/javaee/6/docs/tutorial/doc/gexaj.html#gexba
anybody can help me for finding mirror link for these samples or uploading samples ?
I appreciate you.
thanks
I believe conversion exactly to BigInteger[] would be optimal in my case. Anyone had done or found this written in Java and willing to share?
So imagine I have arbitrary size byte[] = {0xff,0x3e,0x12,0x45,0x1d,0x11,0x2a,0x80,0x81,0x45,0x1d,0x11,0x2a,0x80,0x81}
How do I convert it to array of BigInteger's and then be able to recover it back the original byte array safely?
ty in advance.
I have created a Java application (project) in NetBeans, in which I have designed a JFrame with menu bar, and different JPanels. I want these JPanels to appear inside the JFrame on action of different menu items, so that whenever the menu items are clicked different JPanels should appear inside the JFrame. I have designed both JFrame & JPanel separately, but I couldn't link them together.
Please help me out friends.
JFace Databinding doesn't support generics, so it isn't particularly type-safe. And apparently it never will, since they wish to preserve Java 1.3 support.
JGoodies supports generics since 2.0.0. Has anyone ported JGoodies 2 to SWT/JFace? Or is there another library which allows both?
Hi,
I need huffman code(best in python or in java), which could encode text not by one character (a = 10, b = 11), but by two (ab = 11, ag = 10). Is it possible and if yes, where could i find it, maybe it's somewhere in the internet and i just can'd find it?
Hi.
how can I have a field with variable type in my class? I use hibernate annotation for mapping to DB. I tried to use java.io.Serializable as field's type, but it mapped to database as a 01 amount which is true if I get it's object and cast it to it's true type. but I need to run a query on this objects that needs true amount of field.(right now I can't compare an integer field with a number)
Does anyone have any idea how can I do this?
Thanks in advance.