Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run hello world fail #43

Open
fzzlfzzl opened this issue Jul 3, 2015 · 3 comments
Open

run hello world fail #43

fzzlfzzl opened this issue Jul 3, 2015 · 3 comments

Comments

@fzzlfzzl
Copy link

fzzlfzzl commented Jul 3, 2015

my test class

public class Main{
    public static void main(String args[]){
        System.out.println("Hello World");
    }   
}

and my java version

work@work-desktop:~/workspace/tmp$ echo $JAVA_HOME
/usr/local/etc/jdk1.8.0_45

and i run javac Main.java and java Main,it succ

work@work-desktop:/workspace/tmp$ javac Main.java
work@work-desktop:
/workspace/tmp$ java Main
Hello World

but when i run

jvmgo -XuseJavaHome -cp ./ Main

it fail with such error

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x80cca78]
goroutine 1 [running]:
github.com/zxh0/jvm.go/jvmgo/classpath.func·001(0x1850be90, 0x23, 0x0, 0x0, 0xb7714c70, 0x18538940, 0x0, 0x0)
/home/work/workspace/go/src/github.com/zxh0/jvm.go/jvmgo/classpath/entry_wildcard.go:18 +0x58
path/filepath.Walk(0x1850be90, 0x23, 0x1851b668, 0x0, 0x0)
/usr/local/go/src/path/filepath/path.go:392 +0x97
github.com/zxh0/jvm.go/jvmgo/classpath.newWildcardEntry(0x1850be90, 0x24, 0x4)
/home/work/workspace/go/src/github.com/zxh0/jvm.go/jvmgo/classpath/entry_wildcard.go:28 +0xa9
github.com/zxh0/jvm.go/jvmgo/classpath.(*ClassPath).parseBootAndExtClassPath(0x185300b0)
/home/work/workspace/go/src/github.com/zxh0/jvm.go/jvmgo/classpath/class_path.go:28 +0x252
github.com/zxh0/jvm.go/jvmgo/classpath.Parse(0xbfaab4ab, 0x2, 0x831af40)
/home/work/workspace/go/src/github.com/zxh0/jvm.go/jvmgo/classpath/class_path.go:16 +0x4c
github.com/zxh0/jvm.go/jvmgo/jvm.Startup(0x18538920)
/home/work/workspace/go/src/github.com/zxh0/jvm.go/jvmgo/jvm/jvm.go:32 +0xfe
main.main()
/home/work/workspace/go/src/github.com/zxh0/jvm.go/jvmgo/main.go:15 +0x68
goroutine 2 [runnable]:
runtime.forcegchelper()
/usr/local/go/src/runtime/proc.go:90
runtime.goexit()
/usr/local/go/src/runtime/asm_386.s:2287 +0x1
goroutine 3 [runnable]:
runtime.bgsweep()
/usr/local/go/src/runtime/mgc0.go:82
runtime.goexit()
/usr/local/go/src/runtime/asm_386.s:2287 +0x1
goroutine 4 [runnable]:
runtime.runfinq()
/usr/local/go/src/runtime/malloc.go:712
runtime.goexit()
/usr/local/go/src/runtime/asm_386.s:2287 +0x1

am i wrong? and how to fix that problem?
thank you!

@fzzlfzzl
Copy link
Author

fzzlfzzl commented Jul 3, 2015

i read some code and i know the reason
my JAVA_HOME is my jdk home so the dir JAVA_HOME/lib/ext does not exist
it locate in JAVA_HOME/jre/lib/ext
so i mod JAVA_HOME to jre path and it pass

@zxh0
Copy link
Owner

zxh0 commented Jul 4, 2015

Sorry for the late response. I am a little busy these days. But I will return to this project when I get some free time.

@avelino
Copy link
Contributor

avelino commented Apr 9, 2018

OS: Debian Sid
OpenJDK 9
Java 9 (JDK) not exist lib/ext

λ ~/src/github.com/zxh0/jvm.go/jvmgo/lero/ master* ls /usr/lib/jvm/java-9-openjdk-amd64/lib
accessibility.properties  jli              libawt_headless.so  libinstrument.so  libjavajpeg.so  libjimage.so            libmanagement_ext.so  libprefs.so   libunpack.so          psfont.properties.ja
classlist                 jrt-fs.jar       libawt.so           libj2gss.so       libjava.so      libjsig.so              libmanagement.so      librmi.so     libverify.so          security
ct.sym                    jvm.cfg          libawt_xawt.so      libj2pcsc.so      libjawt.so      libjsound.so            libmlib_image.so      libsaproc.so  libzip.so             server
jar.binfmt                jvm.cfg-default  libdt_socket.so     libj2pkcs11.so    libjdwp.so      liblcms.so              libnet.so             libsctp.so    modules               swing.properties
jexec                     libattach.so     libfontmanager.so   libjaas_unix.so   libjelfshim.so  libmanagement_agent.so  libnio.so             libsunec.so   psfontj2d.properties  tzdb.dat
λ ~/src/github.com/zxh0/jvm.go/jvmgo/lero/ master*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants